SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!
Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.
I have a series of charts with flipped coordinates, and each chart has multiple x-axes at the top (see screenshot). I’ve successfully added titles to the axes but I’m stuck trying to figure out how to reduce the spacing between the titles and the axis labels. In the included screenshot, it is apparent that a lot of real estate is being eaten up by this. These charts are generated dynamically so I need a code, not xaml, solution. I’ve looked into a lot of axis title styling examples but all use a xaml approach, and I’m having trouble translating that style info into code. Could anyone suggest what class(es) to use in the axis constructor, or provide a brief example?
The best tool to diagnose these sorts of things is WPF Snoop. Also the Visual debugger built in to Visual Studio 2017 does the same thing.
You point it at your application, hit ALT+SHIFT and it focuses on elements. Now you can change properties & parameters to find out how to change your view in real-time.
In this case adding a negative margin to AxisTitle seems to do the trick.
Our article Templating the Axis Title shows how to apply styles to the Axis Title. The solution is in XAML, as you will need to create a style to apply to the AxisTitle. You can do this in code but it is a nightmare to write styles in code. What I would suggest instead is to declare your style in XAML and apply it in code.
Please login first to submit.