toddz70
Members-
Content count
5 -
Joined
-
Last visited
About toddz70
-
Rank
Forum Newbie
-
How can I add a bit of custom text to the default value that FC displays for a column? I am using php like $FC->addChartData($my_data_value, $data_value_options); if i set $data_value_options = "displayValue=hello;" then the chart shows "hello" INSTEAD OF the data value. If $data_value_options does not include displayValue, then it shows the properly formatted data value, including Prefix, Suffix, Comma, and Decimals, like "$2,345.67" or "23.45%". But i want BOTH what FC does on its own AND my custom string, afterwards, like this "23.45% hello". Can this be done? or must i take the raw data number, and do my own custom formatting of Prefix, Suffix, Comma, and Decimals, and then add my custom string? thanks!
-
YES !!! Thank you SO much Angshu, that fixed the problem for me! One final question though -- This fix required changing core FusionCharts code. So any future updates to my current of FC will require that I implement this change again. Simple enough, since it is just one line of code. But I wonder.. if this change was required for my site, is it a bug that effects other/all users? If not, why might my site have this problem but others don't? If it is a universal bug, perhaps it will be changed in a future release? Thanks again Angshu. You really saved me on this one.
-
Hmm. If I send FC an ampersand, it is converted to %26. But I am using FC 3.2.1. See all the tests i've done. $FC->addDataset( "red and blue" ); legend / tooltips show "red and blue". Good. $FC->addDataset( "red & blue" ); legend / tooltips show "red %26 blue". BAD. $FC->addDataset( "red & blue" ); legend / tooltips show "red %26amp; blue". BAD. $FC->addDataset( "red %26 blue" ); legend / tooltips show "red %26 blue". BAD. $FC->addDataset( "red %2526 blue" ); legend / tooltips show "red %2526 blue". BAD. $FC->addDataset( "red + blue" ); legend / tooltips show "red %2b blue". BAD. $FC->addDataset( "red \& blue" ); legend / tooltips show "red %26 blue". BAD. Could there be some other function happening that interferes? Like php's htmlentities, html_entity_decode, urlencode, urldecode, addslashes, stripslashes, or something with magicquotes? i don't think so though, since my input to FC is right there in the $FC->addDataset(); Any ideas? Thanks! Todd
-
toddz70 started following Ampersands And Apostrophes Problem
-
Some of my labels and categories have Ampersands and Apostrophes, which FusionCharts is displaying incorrectly. Ampersands become %26 Apostrophes become %26apos; I have tried changing my Ampersands to & and %26 and even %2526. But it never displays a simple normal &. I make this conversion in my php with a simple function alter_display_data() which just does a str_replace("&","&",$myData); and it's given to fusioncharts in $FC->addDataset . $FC->addDataset( alter_display_data($dataset[$i]['region']) ); // ( legend, options ) I read the "Using Special Punctuation on Chart" page in the online docs, but it did not help. I am running FC 3.2, integrated into a WordPress site. thanks in advance! -todd
-
Hi. I am seeking help with setting up a Combination (two Y-Axes) chart using the PHP-Class and reading the data from a MySQL database. I have already successfully done a Single-Series (one Y-Axis) chart with php/mysql. But I don't see anywhere in the docs an exact example of the required php code for doing a Combination chart from a database. My database looks like this: ID YEAR TOPIC MY_VALUE 1 1994 revenue 140000 2 1995 revenue 560000 3 1996 revenue 420000 4 1994 sales 6000 5 1995 sales 24000 6 1996 sales 18000 I want the Combination chart to show: X-axis : YEAR Y-axis Left : REVENUE Y-axis Right : SALES So on the chart the X-axis categories would show the 3 Years (1994, 1995, and 1996). The left Y-axis would show Revenue values (140000, 560000, 420000). And the right Y-axis would show Sales values (6000, 24000, 18000). When I did a Single-Series chart, I read from the database with $FC->addDataFromDatabase. For the Combination chart, I think I need to use $FC->addDatasetsFromDatabase but I can't find enough documentation/sample code for that. I would think I need to use two different database queries, one for each dataset (for each y-axis). Is that incorrect? In the docs (/FusionCharts_Evaluation/Contents/PHPClassAPI/Functions.html), i found addDatasetsFromDatabase(resource $query_result, string $ctrlField, string $valueField[, array $datasetParamArray, string $link]) I tried this but it didn't work: strQuery1 = "SELECT ID, Year, Topic, My_Value FROM myTable WHERE Topic='revenue' ORDER BY Year ASC "; strQuery2 = "SELECT ID, Year, Topic, My_Value FROM myTable WHERE Topic='sales' ORDER BY Year ASC "; $result1 = mysql_query($strQuery1) or die(mysql_error()); $result2 = mysql_query($strQuery2) or die(mysql_error()); $FC->addDatasetsFromDatabase($result1, "Year","My_Value"); $FC->addDatasetsFromDatabase($result2, "Year","My_Value"); $FC->renderChart(); Any help GREATLY appreciated. Thanks! Todd