Group: Forum Members
Last Active: 12 Years Ago
Posts: 3,
Visits: 1
|
Hi, I am creating a legend for a chart control which has points plotted on the ChartControl. I want to resize the legend icons according to the size of the plots in the chart control. Is there a way to do that. Attached is the chart with the legend sizes of the plotted points and the legend icon do not match. Please let me know how to do this Thanks in Advance Manju Sorry missed the attachment
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hi Manju, There is no attachment to the post...
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 12 Years Ago
Posts: 3,
Visits: 1
|
Sorry missed the attachment Thanks Manju
|
Group: Forum Members
Last Active: 6 Months Ago
Posts: 153,
Visits: 11
|
Hi Manjula,
In this case you have to make the point series point size and legend mark size equal - the following code shows how to achieve this:
NChart chart = nChartControl1.Charts[0];
NPointSeries point = new NPointSeries();
NLength pointSize = new NLength(8, NGraphicsUnit.Point); point.Size = pointSize;
point.Values.Add(10); point.Values.Add(20); point.Values.Add(30);
chart.Series.Add(point);
NLegend legend = nChartControl1.Legends[0];
legend.Data.MarkSize = new NSizeL(pointSize, pointSize);
Hope this helps - let us know if you meet any problems.
|
Group: Forum Members
Last Active: 12 Years Ago
Posts: 3,
Visits: 1
|
Thank for you for the information
I already tried this option , if we set legend.Data.MarkSize all the items in the legend will get the same size, i would like to know if its possible to assign different sizes to different items in a legend. For example, if we modify the code you send as follows
NChart chart = nChartControl1.Charts[0];
NPointSeries point = new NPointSeries();
NLength pointSize = new NLength(8, NGraphicsUnit.Point); point.Size = pointSize; point.Values.Add(10); point.Values.Add(20); point.Values.Add(30); chart.Series.Add(point);
NPointSeries point2 = new NPointSeries(); NLength pointSize2 = new NLength(5, NGraphicsUnit.Point); point.Size = pointSize2; point2.Values.Add(10); point2.Values.Add(20); point2.Values.Add(30); chart.Series.Add(point2);
NLegend legend = nChartControl1.Legends[0]; legend.Data.MarkSize = new NSizeL(pointSize, pointSize);
Here point and point2 have different sizes ( 8 and 5 ) which need to be reflected in the legend. Can you please let me know how to do this.
Thanks in advance. Manju
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hi Manjula, Currently the control does not support legends with different mark sizes, but we will amend that in the next version of the control.
Best Regards, Nevron Support Team
|