Posted 28 November 2024, 1:02 pm EST - Updated 28 November 2024, 1:07 pm EST
FlexGrid: Scrollbar location/placement request
Posted by: hdle on 28 November 2024, 1:02 pm EST
-
-
Posted 29 November 2024, 3:06 am EST
Hello Hai,
You can use C1RangeSelector to achieve this requirement. Please refer to the attached sample for implementation. (see FlexChart_ScrollBar.zip)
Please let us know if it fulfils your requirement.
Regards,
Uttkarsh. -
Posted 2 December 2024, 11:36 am EST
Hi Uttkarsh,
Your solution by overlaying with a c1RangeSlider does works for a fixed case. Unfortunately, with different Y Axis range, the
will have to readjust each time. Additionally, as the Axis content changes (vertical text etc,) the slide placement have to be adjusted each time. So while it can be shoe-horned to fit, it won’t be as comfortable.flexChart1.AxisY.Min = -0.5;
Thanks for sharing a work around.
Hai
-
Posted 3 December 2024, 3:30 am EST
Hello Hai,
For this scenario, you can adjust the location and size of the slider in FlexChart’s Rendered event as follows:
//use this to set the AxisY's minimum value instead of AxisY.Min //because AxisY.Min is set by adjusting the RangeSlider between the chart and the AxisX float AxisYMin = 0; private void FlexChart1_Rendered(object? sender, C1.Win.Chart.RenderEventArgs e) { c1RangeSlider1.Location = new Point((int)flexChart1.PlotRect.Left, (int)(flexChart1.PlotRect.Bottom - c1RangeSlider1.Height)); c1RangeSlider1.Width = (int)(flexChart1.PlotRect.Width) - 2; flexChart1.AxisY.Min = AxisYMin + flexChart1.AxisY.ConvertBack(flexChart1.AxisY.Convert(0) + c1RangeSlider1.Height + 2); }
Please refer to the attached modified sample for implementation. (see FlexChart_ScrollBar_Mod.zip)
Regards,
Uttkarsh. -
Posted 3 December 2024, 3:39 pm EST
Uttkarsh,
The code/sample you provider works great with keeping the slider in the right location. However, there some issues that still makes it less ideal.
- Dragging has to occur withing the slider itself, once the mouse goes out of the slider, it will stop the drag. Especially dragging the right side. seems to skip/stop a lot.
- I am using Winform version 4.8 and the C1RangeSlider seems to be different. I cannot change the bar height (c1RangeSlider1.Styles.Bar.Thickness = 0.8D; is not available in NET 4.8, just in 8.0). IN 4.8, the drag issue does not exist.
Overall, this is a great work around that you provided. However, I still prefer that built-in, but I can work with this.
Thanks,
Hai -
Posted 3 December 2024, 3:48 pm EST
Uttkarsh,
Is this work possible for y-Axis?
Thanks,
Hai -
Posted 4 December 2024, 11:53 am EST
Hello Hai,
We have forwarded your concerns to the development team and will get back to you with more information. Please refer to the following tracking IDs for each concern:
- ScrollBar as built-in request: C1WIN-33420
- .Net 8 RangeSlider not sliding properly: C1WIN-33421
- c1RangeSlider1.Styles.Bar.Thickness property in .Net Framework RangeSlider: C1WIN-33422
We have created a sample with .Net FrameWork C1RangeSlider for both the AxisX and AxisY. Please refer to the attached sample. (see FlexChart_AxisScrollBar.zip)
Regards,
Uttkarsh. -
Posted 4 December 2024, 5:59 pm EST
Embarrassing… I couldn’t find the ‘Orientation’ property.
Thanks for putting in the request and the example. You have been extremely helpful!
Hai
-
Posted 11 December 2024, 6:04 am EST
Hello Hai,
As per the team, the request for an inbuilt scrollbar between the Axis and PlotArea seems valid. They will be adding this feature as an option to specify axis scrollbar position.
Furthermore, the team provided a better solution for this requirement. They suggested using a scrollbar on the hidden main axis and adding an auxiliary axis to display labels & ticks. That should provide a similar appearance. Please refer to the attached sample for implementation. (see FlexChart_AxisScrollBar_AlternateSolution.zip)
Regards,
Uttkarsh.