Jump to content

Changing variable in pie charts


DSweet

Recommended Posts

When you fill charting information (specifically a pie chart) with data from a "flat data file", can you control what values actually show on the chart?

 

For example, a "full pie" chart would be made up of 6 slices: var1, var2, var3, var4, var5, and var6 just to make it simple. If Record1 shows all six entries then use all six slices in the chart with all six entries as a legend. However Record2 shows zero values for var2 and var5, the you only show slices for var1, var3, var4, and var6 in the chart and the legend (var2 and var5 are dropped from both). Is there some way of coding

...
if (Field("Var2") > 0)  {
use this variable in chart;
}
...

 

I've not done too much chart and table programming, but we have a new client that will be wanting us to use features like this extensively.

 

Would like to get some ideas on how to go about it.

.

Link to comment
Share on other sites

You're just building up the chart data with a rule anyway, right? So only put as much data in the chart as you're actually using. For instance:

for (var i = 1; i <= 6; i++)
{
   if (Int(Field("Var" + i)))
       result += "<row><cell>" + Field("Var_Desc" + i) + "<cell>" + Int(Field("Var" + i));
}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...