previewict / gchartphp

Automatically exported from code.google.com/p/gchartphp
0 stars 0 forks source link

3d pie chart labels and gBarChart axes labels #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi again, 

I am using the latest gChart.php class as per your message on 12 May and
the link http://code.google.com/p/gchartphp/source/browse/trunk/gChart.php.

I am trying to use the setLabels($labels) function for a 3D pie chart, and
although the array I am using holds 8 values (I have echoed it´s contents
to check this), when the chart is rendered, only the first value is set as
a label on the pie chart. 
Also, is there anyway of setting the data set as labels as well (so the
labels show the names and the values)?

Also, I am a bit stuck with the setting the values of the x and y axis for
a gBarChart. I would like to use the $key values from an associative
array´s $key and $value pairs as the values on the Y axis (with the $values
from the array as the data set. I have the data set part working).

It would be a great help if you could please post an example pie chart with
labels set, and an example bar chart with axes labelled.

Thank you again for your help and work on this :) 

Original issue reported on code.google.com by novak...@gmail.com on 14 May 2010 at 12:37

GoogleCodeExporter commented 9 years ago
Hello,

it is a little difficult to help you because I don't fully understand your 
issues.
Can you share the source code, so I can take a look at it?

For the labels issue, the function setLabels() labels for individual pie chart
slices, while the function setLegend() creates the legend. Do you have enough 
space
in the chart for 8 labels? If the Pie Chart has all the 8 slices, the labels 
should be 8.

If you want to show the labels+value, you have to combine the labels with the 
values
before passing them in setLabels(). However, you can use setLegend() on the 
names and
setLabels() on the values.

Axes setting is a little tricky. Please refer to the wiki page on axes to have 
more
information.

You can find examples both in the project's wiki and in the trunk
(gChartEcample.php). Almost all features of the wrapper are covered there.

Let me know if this help you. I will leave this issue open for awhile.

Original comment by bardellie on 14 May 2010 at 2:16

GoogleCodeExporter commented 9 years ago
Hello again

Thank you for your response and your help.

The problem was to do with the order in which I was calling the following 
methods for
the pie chart. The labels did not show up if I called the setLabels method 
BEFORE the
addDataSet method. Blimey, it took a fair bit of time before I worked this out, 
haha. 

thanks for the great work once again - a big help :)

Original comment by novak...@gmail.com on 16 May 2010 at 2:36

GoogleCodeExporter commented 9 years ago
I am glad that you were able to solve your problem.

Original comment by bardellie on 16 May 2010 at 2:58