ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Call c.xAxis().setLabels
Posted by Ulrich Eul on May-15-2016 17:16
Hello Support-Team

how can I work with >setLabels< dynamic variable or string. In most cases I don't know how much variables are uses for the diagram, when I work with a database. In the best case, I can work with a dynamic Array, but I have test so much, everytimes  an error was occured.

What can I do, can you send me an example?

Best recards,
Ulrich Eul

  Re: Call c.xAxis().setLabels
Posted by Peter Kwan on May-17-2016 01:28
Hi Ulrich,

You can create the array "dynamically". ChartDirector should work exactly the same whether the array is created "dynamically".

If you are not sure how to create the array dynamically, is it possible to inform me of your programming language? The exact way to create an array dynamically is different for different programming languages.

As an example, in C#, a common method is to use List<string>, like:

List<string> labels = new List<string>();

//Add the labels you read from your database to the List<string>
labels.Add("Mon");
labels.Add("Tue");
labels.Add("Wed");
labels.Add("Thu");
labels.Add("Fri");

//The List<string> is not an array at all, but it can be convert to an array using ToArray
c.xAxis().setLabels(labels.ToArray());

Regards
Peter Kwan