Skip to content

How to show informations in graphs using jsp and CanvasJS?

I need to draw graphs with my sql server data .

So I have my servlet that select all data I need and transform it to json , then I forward all data to my jsp.

what I want is to show information like names in my pie graph .

this is my servlet :

and this is the script to show my graph :

The result of this is shown like :

The result of this is shown like :

I want to be like this :

Advertisement

Answer

Try to define legendText on your dataset and indicate, which property contains the label (‘x’ in your case).

Please note that every label (x property) should be different for a pie chart.

User contributions licensed under: CC BY-SA
1 People found this is helpful