Profile Picture

how to change the legend icon size according to the size of the plotted points in the chart

Posted By MANJULA BHAT 13 Years Ago

how to change the legend icon size according to the size of the...

Author
Message
Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 2 days ago @ 1:54 AM
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



MANJULA BHAT
Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

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

bob milanov
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)

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.

MANJULA BHAT
Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 3, Visits: 1
Sorry missed the attachment

Thanks
Manju

Attachments
LegendIconResize.GIF (52 views, 48.00 KB)
Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 2 days ago @ 1:54 AM
Posts: 3,054, Visits: 4,009

Hi Manju,

There is no attachment to the post...



Best Regards,
Nevron Support Team



MANJULA BHAT
questionmark Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

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

Attachments
LegendIconResize.GIF (49 views, 48.00 KB)


Similar Topics


Reading This Topic