|
polar chart with 4 different values |
Posted by Massimo on Apr-22-2013 18:19 |
|
Hi,
I need to draw a polar chart with 4 different sections:
HbA1c
Blood Pressure
BMI
Cholesterol
the previous programmer already built the chart and he found a solution to position the 4 data points on the chart that use algebra calculations.
These calculation are not coded; he basically found out where to add the points on each section according to a "slope" an "intercept" and the value. I believe that this method is not very maintainable because if I re-scale the chart then of course I have to re-calculate the co-ordinates using his formulas.
I am sure that with these values:
data[0] = HbA1cValue;
data[1] = DataValue(SystolicValue, DiastolicValue);
data[2] = BMIValue;
data[3] = CholesterolValue;
and these labels:
string[] labels =
{
"HbA1c<*br*><*font=Arial*>" + values[0] + "<*br*>" + Hba1cValueDate,
"Blood Pressure<*br*><*font=Arial*>" + values[1] + "<*br*>" + BloodPressureDate,
"Body Mass Index<*br*><*font=Arial*>" + values[2] + "<*br*>" + CholesterolDate,
"Total Cholesterol<*br*><*font=Arial*>" + values[3] + "<*br*>" + BmiDate
};
Chart director can automatically calculate the positions of the 4 points.
To better explain myself I have attached a screenshot of the existing chart and a text file with the code used to generate the chart.
The values on the chart displays correctly; I am simply trying to find out a way to avoid algebra calculations every time I need to re-scale the chart for the 4 points.
|
Re: polar chart with 4 different values |
Posted by Peter Kwan on Apr-22-2013 23:20 |
|
Hi Massimo,
In your code, there is a function "DataValue" and "DataValueHab1c" that modifies your raw data value before storing them into the data array. As your attachment does not include what is "DataValue" or "DataValueHab1c", I can only guess what are their purpose. I speculate that these functions are just ways to specify the scale you would like to use. If this it the case, then you can re-scaling the chart and it would still work. (By scaling, I mean changing the size of the chart.)
For example, consider the Body Mass Index. ChartDirector cannot automatically determine that 20-25 is green, while 25-30 is yellow, and >30 is red (as ChartDirector does not know what is "Body Mass Index" and does not have medical knowledge). So somewhere in your program, there must be code to reflect that scale. The "slope" and "intercept" (or other values it may be using) simply reflects green/yellow/red scale you would like to use. If this it the case, chaning the chart size will not cause the chart to be plotted different. The green/yellow/red zones will still be representing 20-25, 25-30 and >30.
Hope this can help.
Regards
Peter Kwan |
Re: polar chart with 4 different values |
Posted by Massimo on Apr-22-2013 23:47 |
|
Hi Peter,
thanks for your reply
sorry for not adding all the code; I am taking on someone else code and I am trying to figure it out myself what I have in my hand...
yes the 2 mentioned functions have the purposes to scale the original values on the chart within the right ranges (red, green or yellow).
I will keep using the method that I found from my previous colleague then. |
|