Profile Picture

editable automatic legend

Posted By Daniel Csimszi 11 Years Ago
Author
Message
Daniel Csimszi
questionmark Posted 11 Years Ago
View Quick Profile
Forum Guru

Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)

Group: Forum Members
Last Active: 8 Years Ago
Posts: 61, Visits: 35
Hi,

I try to let the user to edit the text of the legend, but I still would like that it adds automatic with the color and so on. I tried to retrieve the legends by index from the legend list and just edit its title, but it does not seems to be working as there are no items in the legend list.

Is it any way to do it similar to that, or do I need to create all of the legends manually?

This is the code of my legend:
m_Legend = new NLegend();
m_Legend.Mode = LegendMode.Automatic;

m_Chart.DisplayOnLegend = m_Legend;
m_Legend.Visible = true;
m_Legend.Dock = DockStyle.Bottom;
m_Legend.Data.ExpandMode = (LegendExpandMode)1;
Array values = Enum.GetValues(typeof(ContentAlignment));
m_Legend.FitAlignment = (ContentAlignment)values.GetValue(7);


nChartControl1.Panels.Add(m_Legend);

Retrieve the Legend:
NLegendItemCellData legend = (NLegendItemCellData)m_Legend.Data.Items[index];


Anything I am missing?

Thank you,
Daniel

Nevron Support
Posted 11 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: 1 days ago @ 1:54 AM
Posts: 3,054, Visits: 4,009

Hi Daniel,

When the legend is in automatic mode the legend items will be automatically populated during chart document recalculation so it is not recommended to access the data items in this case. In general if you want editable legend entries we would recommend to manually populate / edit the legend items.



Best Regards,
Nevron Support Team



Daniel Csimszi
Posted 11 Years Ago
View Quick Profile
Forum Guru

Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)

Group: Forum Members
Last Active: 8 Years Ago
Posts: 61, Visits: 35
OK,

Be honest the only reason why it would be important for me because users might want to add measuring units after the name. I still will need everything what the automatic legends generates anyway.

But if that is not really possible, then it is fine.

Thanks



Similar Topics


Reading This Topic