Please I have been trying this but seems difficult. I am trying to make the number of y-axis depend on the user selection. There are 3 sections for user to select from, namely:
- Time range for the plot
- ID to plot, which will be taken from database
- Field to search in the database
If the user selects 2 ID and 2 Field, then I should have 4 different lines on the plot. Which means that:
number of lines = number of ID selected * number of Field selected
With that I know I will get same number for the labels in the legend and also for the number of y-axis to be displayed.
For the example I gave, it should be something like:
- Field_1-ID_1
- Field_2-ID_1
- Field_1-ID_2
- Field_2-ID_2
for the legend label and the y-axis to be produced, but it all depends on the user selection.
Thank you for your attention.
I finally found a way to resolve this by generating from the php side, the elements for the series property in the jqplot in its expected format i.e.
If anyone is interested in how it is done, please check the code below:
The output of that php is like:
Then in the jqplot function, I set series to be Label: