Setting list of values for a pie chart
Posted: Fri Jan 12, 2018 1:29 am
Hi,
I need to create a pie chart that is based on pavement condition data. The datasource is a dynamically filled data table that
I am not able to modify. If this were a SQL Based datasource the task would be fairly easy, but it isn't so I'm stuck looking for
an alternate solution. There is a column on the datasource I have that contains an integer score ranging from 0 to 100. The
scores need to be "classified" into the following categories
Poor <= 40
Fair > 40 AND <= 60
Good > 60 AND <= 80
Excellent > 80
For each category I need the sum of another field that contains the length of road segments. The pie chart should display
for each category the sum of road segment lengths. To test this, I added the following to the list of arguments for the
report... Poor;Fair. I tried adding the following to the list of values... {SumIf(GISAttributes.LANE_MILE,GISAttributes.OCI <= 40)};{SumIf(GISAttributes.LANE_MILE,GISAttributes.OCI > 40 && GISAttributes.OCI <= 60)}, but that throws a "The name 'SumIf' does not exist in the current context"
error.
I then tried creating two integer variables to store the values and put the following in the BeforePrint event of the chart (I also tried putting the expressions
in the BeginRender event of the Chart).
var1 = (int)SumIf(GISAttributes.LANE_MILE,GISAttributes.OCI <= 40);
var2 = (int)SumIf(GISAttributes.LANE_MILE,GISAttributes.OCI > 40 && GISAttributes.OCI <= 60);
I don't get any errors with this approach, but I also don't get anything showing up in the chart because the values of var1 & var2 both equal 0.
Can you suggest an approach for doing what I'm trying - if it is even possible?
Thanks,
Carl
I need to create a pie chart that is based on pavement condition data. The datasource is a dynamically filled data table that
I am not able to modify. If this were a SQL Based datasource the task would be fairly easy, but it isn't so I'm stuck looking for
an alternate solution. There is a column on the datasource I have that contains an integer score ranging from 0 to 100. The
scores need to be "classified" into the following categories
Poor <= 40
Fair > 40 AND <= 60
Good > 60 AND <= 80
Excellent > 80
For each category I need the sum of another field that contains the length of road segments. The pie chart should display
for each category the sum of road segment lengths. To test this, I added the following to the list of arguments for the
report... Poor;Fair. I tried adding the following to the list of values... {SumIf(GISAttributes.LANE_MILE,GISAttributes.OCI <= 40)};{SumIf(GISAttributes.LANE_MILE,GISAttributes.OCI > 40 && GISAttributes.OCI <= 60)}, but that throws a "The name 'SumIf' does not exist in the current context"
error.
I then tried creating two integer variables to store the values and put the following in the BeforePrint event of the chart (I also tried putting the expressions
in the BeginRender event of the Chart).
var1 = (int)SumIf(GISAttributes.LANE_MILE,GISAttributes.OCI <= 40);
var2 = (int)SumIf(GISAttributes.LANE_MILE,GISAttributes.OCI > 40 && GISAttributes.OCI <= 60);
I don't get any errors with this approach, but I also don't get anything showing up in the chart because the values of var1 & var2 both equal 0.
Can you suggest an approach for doing what I'm trying - if it is even possible?
Thanks,
Carl