By Devin Ellis - 6 Years Ago
|
I have been trying to figure out how to add general text labels to a graph. I have seen some references on adding a label tied to a value on a axis, but what I need is a general label below the x axis that is not tied to a value like the link below, How do I do that?
Chart Lables
|
By Nevron Support - 6 Years Ago
|
Hi Devin, The following sample shows how to add a scale title and header and footer labels: nChartControl1.Panels.Clear();
NLabel header = new NLabel("Some Header Text"); header.DockMode = PanelDockMode.Top; nChartControl1.Panels.Add(header);
NLabel footer = new NLabel("Some Footer Text"); footer.DockMode = PanelDockMode.Bottom; nChartControl1.Panels.Add(footer);
NCartesianChart chart = new NCartesianChart(); chart.DockMode = PanelDockMode.Fill; nChartControl1.Panels.Add(chart);
chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator.Title.Text = "Y Axis Title"; chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator.Title.Text = "X Axis Title";
NBarSeries bar = new NBarSeries();
bar.Values.Add(10); bar.Values.Add(20); bar.Values.Add(30);
chart.Series.Add(bar); You can also take a look at the Panels \ Labels examples that show how to apply XML formatting to labels. Let us know if you meet any problems or have any questions.
|