Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1175
Can I get the default row and column labels?
posted

I know that to set the row and column labels you do this

ctrlUltraChart.Data.SetRowLabels(strArray);

ctrlUltraChart.Data.SetColumnLabels(strArray);

and to get the labels that have been manually set you use

string[ strRowLabels = ctrlUltraChart.Data.GetRowLabels();

string[ strColLabels = ctrlUltraChart.Data.GetColumnLabels();

 but how do I get the labels that are automatically set by the ultrachart?

Parents
  • 26458
    Offline posted

    The default labels can only be extracted before you set them manually, so this approach may or may not work depending on when you set the labels.

    List<string> rowLabels = new List<string>();
    List<string> columnLabels = new List<string>();

    protected void UltraChart1_FillSceneGraph(object sender, FillSceneGraphEventArgs e)
    {
      IChartData chartData = e.ChartCore.GetChartLayer().GetData();
      int rowCount = chartData.GetRowCount();
      int colCount = chartData.GetColumnCount();

      for (int i = 0; i < rowCount; i++)
        rowLabels.Add(chartData.GetRowLabel(i).ToString());

      for (int i = 0; i < colCount; i++)
        columnLabels.Add(chartData.GetColumnLabel(i).ToString());
    }

Reply Children