Hi,

I'm trying to make a column chart using a calculated Math expression field.

I have an 'unformatted list' version of my view which outputs these data:

0.12
Jan-11

0.33333333333333
Feb-11

0.5
Mar-11

0.14285714285714
Apr-11

8.16285714285714
May-11

0.5
Jun-11

10.20428571428572
Jul-11

but when I make the view a Dataviz view, every column shows the value '1' and not the calculated value. Is this a bug/incompatibility with the calculated Math expression field or am I doing something wrong?

If I don't use a calculated Math expression field everything works as it should.

Any ideas?

Comments

namwebs’s picture

I couldn't get the Global Math Expression field to work so in the end I did a workaround using a Global PHP field. In case it helps anyone else: in the output code I assigned variables and did the calculation (see below), made sure there were no styles set in the Styles Settings, stripped html and removed whitespace in the Rewrite Results options and then used the PHP field in the chart.

Output code:

$sght=$data->field_data_field_baboon_si_field_baboon_si_value;
$drvs= $data->field_data_field_number_of_game_drives_field_number_of_game_;
$index=$sght/$drvs;
$index100=$index*100;
print $index100;