I'm working towards enabling a clean implementation of allowing multiple Y axis.
Something I really liek is the automatic Y axis placement, using as little hozontal space as possible.
I have a graph that looks liek this:
However, when I draw my scroll bars in, it draws them right on top of the axis I had drawn:
Im in kind of a "have my cake and eat it too" situation. I'd like for the autoviewxy layout stuff to work, but I always want to "hard code" in a 12px padding so I can place my scroll bars there.
How would you approach this issue?
Thanks!
ViewXY - making room for scrollbars with autoplacement
Moderator: Queue Moderators
-
- Posts: 183
- Joined: Tue Mar 18, 2014 2:55 pm
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: ViewXY - making room for scrollbars with autoplacement
Maybe this will help: http://www.arction.com/forum/viewtopic. ... weak#p2688
LightningChart Support Team, PT
-
- Posts: 183
- Joined: Tue Mar 18, 2014 2:55 pm
Re: ViewXY - making room for scrollbars with autoplacement
That method is VERY hard to use, i've spent all day tinkering with it, and i feel like im farther away than i was frmo the very start.
Here is my goal: I want all the benefits of autoformatting the axis, but with the addition of padding the bottom and left side 15px for a scrollbar. The code sample below is a pretty simple example, i havent even accounted for the 15px scrollbar.
Using this logic for laying out my axis already breaks when I use multiple Y axis. It does not shrink the chart space to accomidate the additional axis (screenshot below).
How do I use this logic to achieve my goal?
Screenshot of what happens after i call the previous margin code every time after I add an axis
Here is my goal: I want all the benefits of autoformatting the axis, but with the addition of padding the bottom and left side 15px for a scrollbar. The code sample below is a pretty simple example, i havent even accounted for the 15px scrollbar.
Using this logic for laying out my axis already breaks when I use multiple Y axis. It does not shrink the chart space to accomidate the additional axis (screenshot below).
How do I use this logic to achieve my goal?
Code: Select all
chart.BeginUpdate();
//Special tweak: Let the rendering code run, but don't render
chart.TweakDisablePresent();
chart.ViewXY.AxisLayout.AutoAdjustMargins = true;
chart.EndUpdate();
Rectangle r = chart.ViewXY.GetMarginsRect();
chart.BeginUpdate();
chart.ViewXY.AxisLayout.AutoAdjustMargins = false;
//User left, top and bottom as they were measured by contents of axis labels, but change right margin
//chart.ViewXY.Margins = new Padding(
// r.Left + ScrollbarVerticalWidth,
// r.Top,
// chart.ClientSize.Width - r.Right,
// chart.ClientSize.Height - r.Bottom + ScrollbarHorizontalHeight);
chart.ViewXY.Margins = new Padding(
r.Left, // + ScrollbarVerticalWidth,
r.Top,
//r.Right,
//r.Bottom);
chart.ClientSize.Width - r.Right,
chart.ClientSize.Height - r.Bottom);// + ScrollbarHorizontalHeight);
//Special tweak: enable rendering.
chart.TweakEnablePresent();
chart.EndUpdate();