I want to set "want.jpg".
When the size of the chart changes.
example 1)
----------------------------------------------------------
Series1, Series2, Series3, Series4, Series5, Series6
Series7
----------------------------------------------------------
example 2)
----------------------------------------------------------
Series1, Series2, Series3, Series4, Series5
Series6, Series7
----------------------------------------------------------
How is it set?
How to set layout the legendbox?
Moderator: Queue Moderators
How to set layout the legendbox?
- Attachments
-
- want.png (104.85 KiB) Viewed 13553 times
-
- real.png (121.89 KiB) Viewed 13553 times
- ArctionNikolai
- Posts: 38
- Joined: Fri Feb 05, 2016 11:37 am
- Location: Finland
- Contact:
Re: How to set layout the legendbox?
Hello,
My name is Nikolai and I am representative of Arction. Thank you for your question.
Each chart component is very flexible. I offer you to implement the following instructions to achieve the needed results:
- Сalculate LegendBox width. Get the width of the chart area.
- Increase margins to place legend box where you need. Set property chart.ViewXY.Margins. In your case, increase Margin.Top.
- Change LegendBox offset: X = 0; Y = 0. To place box in the top.
I hope it helps you in your projects. I am happy to answer all your further questions.
Best regards
My name is Nikolai and I am representative of Arction. Thank you for your question.
Each chart component is very flexible. I offer you to implement the following instructions to achieve the needed results:
- Сalculate LegendBox width. Get the width of the chart area.
- Increase margins to place legend box where you need. Set property chart.ViewXY.Margins. In your case, increase Margin.Top.
- Change LegendBox offset: X = 0; Y = 0. To place box in the top.
I hope it helps you in your projects. I am happy to answer all your further questions.
Best regards
Nikolai Arsenov
Software developer
Arction Ltd
Microkatu 1, 70210 Kuopio, Finland
Software developer
Arction Ltd
Microkatu 1, 70210 Kuopio, Finland
Re: How to set layout the legendbox?
I'm sorry.
I am not so good at English.
So please be good to understand my awkward English.
It is not a question of margins.
I want to place the series in the legend box.
Series order of "real2.png" is shown below.
=====================================
series1, series2, series3
series4, series5, series6
series7
=====================================
but, i want ↓
=====================================
series1, series2, series3, series4, series5, series6
series7
=====================================
Thank you. T_T
I am not so good at English.
So please be good to understand my awkward English.
It is not a question of margins.
I want to place the series in the legend box.
Series order of "real2.png" is shown below.
=====================================
series1, series2, series3
series4, series5, series6
series7
=====================================
but, i want ↓
=====================================
series1, series2, series3, series4, series5, series6
series7
=====================================
Thank you. T_T
- Attachments
-
- real2.png (126.16 KiB) Viewed 13535 times
- ArctionNikolai
- Posts: 38
- Joined: Fri Feb 05, 2016 11:37 am
- Location: Finland
- Contact:
Re: How to set layout the legendbox?
Oh no, your English is good.
Try to configure legend box in the code :
- Set LegendBox layout to HorizontalRowSpan
We have similar result what you want in demo application in Showcase examples: "Scrolling, layered axes".
I hope it will help.
Best regards and have a good day,
Nikolai
Try to configure legend box in the code :
- Set LegendBox layout to HorizontalRowSpan
Code: Select all
chart.ViewXY.LegendBox.Layout = LegendBoxLayout.HorizontalRowSpan;
Best regards and have a good day,
Nikolai
Nikolai Arsenov
Software developer
Arction Ltd
Microkatu 1, 70210 Kuopio, Finland
Software developer
Arction Ltd
Microkatu 1, 70210 Kuopio, Finland
Re: How to set layout the legendbox?
Thank you for answer.
When I "YAxes Layout = YAxes Layout.Layered, AxisLayout.Auto Adjust Margins = false", I want to calculate the width of YAsixs.
Thank you.
When I "YAxes Layout = YAxes Layout.Layered, AxisLayout.Auto Adjust Margins = false", I want to calculate the width of YAsixs.
Code: Select all
var r = chart.ViewXY.LegendBox.GetRenderedRect();
#warning How to calculate left margin?
chart.ViewXY.Margins = new Padding(80, r.Y + r.Height + 10, 30, 30);
- Attachments
-
- how to get yaxis width.png (163.46 KiB) Viewed 13520 times
Re: How to set layout the legendbox?
Oh, i find it.
Thank you~~~~
Thank you~~~~
Code: Select all
chart.BeginUpdate();
chart.TweakDisablePresent();
chart.ViewXY.AxisLayout.AutoAdjustMargins = true;
chart.EndUpdate();
Rectangle r = chart.ViewXY.GetMarginsRect();
chart.BeginUpdate();
chart.ViewXY.AxisLayout.AutoAdjustMargins = false;
var ra = chart.ViewXY.LegendBox.GetRenderedRect();
chart.ViewXY.Margins = new Padding(r.Left, ra.Y + ra.Height + 10,
chart.ClientSize.Width - r.Right,
chart.ClientSize.Height - r.Bottom);
chart.TweakEnablePresent();
chart.EndUpdate();
- ArctionNikolai
- Posts: 38
- Joined: Fri Feb 05, 2016 11:37 am
- Location: Finland
- Contact:
Re: How to set layout the legendbox?
Always welcome.
Enjoy your coding with LightningChart
Enjoy your coding with LightningChart
Nikolai Arsenov
Software developer
Arction Ltd
Microkatu 1, 70210 Kuopio, Finland
Software developer
Arction Ltd
Microkatu 1, 70210 Kuopio, Finland