Search the Community
Showing results for tags 'JSON'.
Found 18 results
-
i'm trying to process data from a query. So I create a JSON object and populate it using a loop, like so: var processedData = [{ label: "teste", value: 123 }, { label: "teste2", value: 321 }]; if (dataParse.response) { dataParse = dataParse.response; for (var aux of dataParse) { jsonAux = { label: aux.departamento, value: parseInt(aux.quantidade) } processedData.push(jsonAux); } } after the loop, the object is returned and used as chart data. As seen in the image attached, it is done without problems (For testing purposes, i initialized the object "processedData" with two test elements: "teste1" and "teste2"). But FusionChart can only load the initiliazed elements. I don't have any idea why this is happening and already tried many different ways to do this. Would be really glad if someone could be of use. Thanks in advance.
- 3 replies
-
- javascrip
- fusioncharts
-
(and 2 more)
Tagged with:
-
Hi there I've been diving into forum and docs, but I think I'm going in the wrong direction. I'm trying to show a multi-series line chart. Only 3 data in the query: date, device and data. The format in query is like that: devicename (string) | date (datetime)| data (float) What I want is to show a line for every device and see data along the time. I've seen several examples with xml, but none with json. Could anyone show me an example of something similar? I know there must be lots of them, but I cannot find even one. My main problem is arrange the json. I have no experience with it but I think I coud use an example as a guide. Thanks for all!
-
Hi all FusionCharts folks, I'm trying to populate GANTT chart by database (PHP+MySQL). I was able to implement my own script based on the general method based on the conceptual sequence: 1) Execute queries on database 2) If results is not empty... 3)...proceed with "array_push" to concatenate data to be displayed by the chart. The code below implements the above sequence: // Execute the query, or else return the error message. $result_CATEGORIES = mysqli_query($dbhandle, $strQuery_CATEGORIES); //prepare categories $arrData["categories"] = array(); $category = array(); // Push the data into the category array while($row = mysqli_fetch_array($result_CATEGORIES)) { array_push($category, array("label"=>$row["abbr_mese"], "start"=>$row["frm_inizio_mese"], "end"=>$row["frm_fine_mese"])); } echo "<pre>"; echo "ARRAY CATEGORIES CONTENTS"."<p>"; echo print_r ($category); echo "</pre>"; array_push($arrData["categories"], array("category"=>$category)); After repeated excecution of the above code for all the data-section required by the GANTT chart the final assembled JSONencoded string is the following: {"chart":{"renderAt:":"chart-1","dateformat":"mm\/dd\/yyyy","caption":"Commesse Associate al Collaboratore","subCaption":"Assistenza al Planning","theme":"fusion"},"categories":[{"category":[{"label":"GEN","start":"01\/01\/2019","end":"01\/31\/2019"},{"label":"FEB","start":"02\/01\/2019","end":"02\/28\/2019"},{"label":"MAR","start":"03\/01\/2019","end":"03\/31\/2019"},{"label":"APR","start":"04\/01\/2019","end":"04\/30\/2019"},{"label":"MAG","start":"05\/01\/2019","end":"05\/31\/2019"},{"label":"GIU","start":"06\/01\/2019","end":"06\/30\/2019"},{"label":"LUG","start":"07\/01\/2019","end":"07\/31\/2019"},{"label":"AGO","start":"08\/01\/2019","end":"08\/31\/2019"},{"label":"SET","start":"09\/01\/2019","end":"09\/30\/2019"},{"label":"OTT","start":"10\/01\/2019","end":"10\/31\/2019"},{"label":"NOV","start":"11\/01\/2019","end":"11\/30\/2019"},{"label":"DIC","start":"12\/01\/2019","end":"12\/31\/2019"}]}],"processes":[{"process":[{"headerText":"SIL"},{"headerText":"BIOM"},{"headerText":"BIOM"}]}],"tasks":[{"task":[{"start":"01\/15\/2019","end":"01\/28\/2019"},{"start":"02\/07\/2019","end":"03\/21\/2019"},{"start":"02\/20\/2019","end":"05\/11\/2019"}]}]} I checked against it and it is (at least as per its syntax) perfectly valid JSON Here it is the same JSON string nicely formatted: { "chart": { "renderAt:": "chart-1", "dateformat": "mm\/dd\/yyyy", "caption": "Commesse Associate al Collaboratore", "subCaption": "Assistenza al Planning", "theme": "fusion" }, "categories": [{ "category": [{ "label": "GEN", "start": "01\/01\/2019", "end": "01\/31\/2019" }, { "label": "FEB", "start": "02\/01\/2019", "end": "02\/28\/2019" }, { "label": "MAR", "start": "03\/01\/2019", "end": "03\/31\/2019" }, { "label": "APR", "start": "04\/01\/2019", "end": "04\/30\/2019" }, { "label": "MAG", "start": "05\/01\/2019", "end": "05\/31\/2019" }, { "label": "GIU", "start": "06\/01\/2019", "end": "06\/30\/2019" }, { "label": "LUG", "start": "07\/01\/2019", "end": "07\/31\/2019" }, { "label": "AGO", "start": "08\/01\/2019", "end": "08\/31\/2019" }, { "label": "SET", "start": "09\/01\/2019", "end": "09\/30\/2019" }, { "label": "OTT", "start": "10\/01\/2019", "end": "10\/31\/2019" }, { "label": "NOV", "start": "11\/01\/2019", "end": "11\/30\/2019" }, { "label": "DIC", "start": "12\/01\/2019", "end": "12\/31\/2019" }] }], "processes": [{ "process": [{ "headerText": "SIL" }, { "headerText": "BIOM" }, { "headerText": "BIOM" }] }], "tasks": [{ "task": [{ "start": "01\/15\/2019", "end": "01\/28\/2019" }, { "start": "02\/07\/2019", "end": "03\/21\/2019" }, { "start": "02\/20\/2019", "end": "05\/11\/2019" }] }] } Nonetheless, fed by the above JSON encoded string, the rendering of the chart keeps returning the message "No Data To Display". I did my investigations and discovered that stripping away from the JSONencoded string the first "[" and the last "]" from the sections "processes" and "tasks" the chart renders as a breeze with proper data and labels in place. It looks like the chart doesn't want these sections (which of course follows the main one "categories") marked as an array. May be the problem is not in the terms I have just stated but I'm looking for a solution. Thank you in advance, I greatly appreciate FC, any help is more than wellcome!
-
I'm trying to create a stacked chart with from a database into a JSON Append object and am having some trouble. I have a set a weeks to display on the X axis. The Y axis will display a number of Hours per status. This is my first chart with a JSON object within MVC and instead of getting an error message, the screen just shows "Charts...." text. I believe my issue is mainly within my foreach loop through the status. I also need to implement the passing of the week along with the status so that I am getting the "Hours" for that status and week. Please let me know if you have any questions. I have all my code in page for now. Thank You!! --------------------------------------------------------------- public class WOWeekData { //public int lworkweekcode { get; set; } public DateTime WkDate { get; set; } } public class WOHrsData { //public int WOStatusID { get; set; } //public int lworkweekcode { get; set; } public string WOStatus { get; set; } public int WkHrs { get; set; } public DateTime WkDate { get; set; } } public class HomeController : Controller { List<WOWeekData> wdata_list = new List<WOWeekData>(); List<WOHrsData> hdata_list = new List<WOHrsData>(); public string createChart() { string dat = getData(); Chart cc = new Chart("stackedcolumn3d", "mychart", "750", "550", "json", dat); return cc.Render(); } public string getData() { List<DateTime> WOWkDate2_list = new List<DateTime>(); List<string> WOStatus_list = new List<string>(); List<int> WOWkHrs_list = new List<int>(); List<DateTime> WOWkDate_list = new List<DateTime>(); string db= ConfigurationManager.ConnectionStrings["string"].ConnectionString; SqlConnection con = new SqlConnection(); con.ConnectionString = db; con.Open(); SqlCommand com = new SqlCommand("Select distinct(WkDate) from v_SampleData2", con); SqlDataReader sda = com.ExecuteReader(); while (sda.Read()) { WOWeekData wod = new WOWeekData(); wod.WkDate = DateTime.Parse(sda[0].ToString()); //wod.W = Int32.Parse(sda[1].ToString()); //wod.P = Int32.Parse(sda[2].ToString()); //wod.H = Int32.Parse(sda[3].ToString()); wdata_list.Add(wod); } foreach (WOWeekData w in wdata_list) { WOWkDate_list.Add(w.WkDate); } sda.Close(); SqlCommand com2 = new SqlCommand("Select * from v_SampleData2", con); SqlDataReader sda2 = com2.ExecuteReader(); while (sda2.Read()) { WOHrsData hrs = new WOHrsData(); hrs.WOStatus = sda2[1].ToString(); hrs.WkHrs = Int32.Parse(sda2[2].ToString()); hrs.WkDate = DateTime.Parse(sda2[0].ToString()); hdata_list.Add(hrs); } foreach (WOHrsData h in hdata_list) { //WOWk.Add(h.WkDate); WOStatus_list.Add(h.WOStatus); WOWkHrs_list.Add(h.WkHrs); WOWkDate2_list.Add(h.WkDate); } sda2.Close(); con.Close(); con.Dispose(); //building JSON String StringBuilder JSON = new StringBuilder(); JSON.Append("{" + "'chart': {" + "'caption': 'One Chart Per Department'," + // "'exportEnabled':'1'," + "'xAxisname': 'Weeks'," + "'yAxisName': 'Hours'," + " }," ); //appenfing into StringBuilder objectiterating through collections JSON.Append("'categories': [{" + "'category': [ "); foreach (var wk in WOWkDate_list.Distinct()) { //for last element escaping comma if (wk == WOWkDate_list.Distinct().Last()) { JSON.Append("{ 'label': '" + wk + "' }"); break; } JSON.Append("{ 'label': '" + wk + "' },"); } JSON.Append("]" + "}]," + "'dataset': ["); foreach (var wostat in WOStatus_list.Distinct()) { List<int> wohrsvalue = getWOHrsData(wostat); JSON.Append("{" + "'seriesname':" + "'" + wostat + "'," + "'data': ["); foreach (var whrs in wohrsvalue) { if (whrs == wohrsvalue.Last()) { JSON.Append("{" + "'value':" + "'" + whrs + "'}"); break; } JSON.Append("{" + "'value':" + "'" + whrs + "'},"); } if (wostat == WOStatus_list.Distinct().Last()) { JSON.Append("]" + " }"); break; } JSON.Append("]" + " },"); } //replacing all ' into " string str = JSON.ToString().Replace('\'', '\"'); return str; } public List<int> getWOHrsData(string wostat) { List<int> hrsvalue = new List<int>(); var seriesLink = from wo in hdata_list where wo.WOStatus == wostat select new { linkdata = wo.WkHrs }; foreach (var obj in seriesLink) { hrsvalue.Add(obj.linkdata); } return hrsvalue; } public ActionResult Index() { ViewBag.mydata = createChart(); return View(); } public ActionResult About() { ViewBag.Message = "Your application description page."; return View(); } public ActionResult Contact() { ViewBag.Message = "Your contact page."; return View(); } }
-
Hi There is any Data value click event for Pyramid chart. My requirement is need to display the pop up while click on the data value DataplotclickEvent is work fine while click on the green or blue color etc.. I need the same thing on data value like management or senior analyst or etc.. Plz someone help to solve this tricky thing I have spend long time by searching in google and document. I cant able to get the answer for the above Question.
-
Hello there, I'm using MySQL/PHP with PHPWrapper to make use of the FusionCharts. I've been able to get the data to get it rendered as 2D column stacks but are stuck at 7 despite having any limits attached to it. I'm using it to display the count of records for each month starting Apr, till Nov but the first stack starts from May when I Group the data by month in ASC. The interesting bit is that when i change this to DESC, i see the data from OCt- Apr (7 records) and the Nov data goes missing. I have not kept any limits defined that may be stopping this but yet i can get this to work. My data set type in MySQL are; acqid - INT acq_month - DATE fusioncharts.php & its associated JS are properly called upon in the file. Can anyone help? Thanks!!! Following is the code that I'm using; <?php // Form the SQL query that returns the top 10 most populous countries $strQuery = "SELECT count(acqid), acq_month FROM newacq GROUP BY MONTH(acq_month) ASC limit 13"; // Execute the query, or else return the error message. $result = $conn->query($strQuery) or exit("Error code ({$conn->errno}): {$conn->error}"); $arr=mysqli_fetch_array($result); //while($arr=mysqli_fetch_array($result)) { // print_r($arr); //} // If the query returns a valid response, prepare the JSON string if ($result) { // The `$arrData` array holds the chart attributes and data $arrData = array( "chart" => array( "caption" => "New Acq", "showValues" => "1", "theme" => "zune" ) ); $arrData["data"] = array(); // Push the data into the array while($row = mysqli_fetch_array($result)) { array_push($arrData["data"], array( "label" => date("M-Y", strtotime($row["acq_month"])), "value" => $row["count(acqid)"], ) ); } /*JSON Encode the data to retrieve the string containing the JSON representation of the data in the array. */ $jsonEncodedData = json_encode($arrData); /*Create an object for the column chart using the FusionCharts PHP class constructor. Syntax for the constructor is ` FusionCharts("type of chart", "unique chart id", width of the chart, height of the chart, "div id to render the chart", "data format", "data source")`. Because we are using JSON data to render the chart, the data format will be `json`. The variable `$jsonEncodeData` holds all the JSON data for the chart, and will be passed as the value for the data source parameter of the constructor.*/ $columnChart = new FusionCharts("column2D", "myFirstChart" , 820, 300, "chart-1", "json", $jsonEncodedData); // Render the chart $columnChart->render(); // Close the database connection $conn->close(); } ?> <div id="chart-1"><!-- Fusion Charts will render here--></div> With ASC this is how it appears; And with DESC this is how it appears; EDIT - When i tried fetching the details carried out in the ARRAY using [print_r], I got the following message; Array ( [0] => 208 [count(acqid)] => 208 [1] => 2017-04-01 [acq_month] => 2017-04-01 ) Array ( [0] => 241 [count(acqid)] => 241 [1] => 2017-05-01 [acq_month] => 2017-05-01 ) Array ( [0] => 243 [count(acqid)] => 243 [1] => 2017-06-01 [acq_month] => 2017-06-01 ) Array ( [0] => 269 [count(acqid)] => 269 [1] => 2017-07-01 [acq_month] => 2017-07-01 ) Array ( [0] => 373 [count(acqid)] => 373 [1] => 2017-08-01 [acq_month] => 2017-08-01 ) Array ( [0] => 370 [count(acqid)] => 370 [1] => 2017-09-01 [acq_month] => 2017-09-01 ) Array ( [0] => 283 [count(acqid)] => 283 [1] => 2017-10-01 [acq_month] => 2017-10-01 ) Array ( [0] => 312 [count(acqid)] => 312 [1] => 2017-11-01 [acq_month] => 2017-11-01 ) It does show the information carried out for April & Nov including. If it helps!
-
Custom PDF containing chart from json data at server side
anurag.porwal posted a topic in General usage
using itext render at server side to to generate pdf from HTML (passed in ajax call) , need is to fit fusion chart also in pdf...data is in json format..please suggest- 1 reply
-
- itext renderer
- json
-
(and 2 more)
Tagged with:
-
First value in dataseries duplicating in msline chart PHP JSON
waflfootyfacts posted a topic in FusionCharts and PHP
I am trying to create an msline chart using PHP and JSON to display data from my SQL database using the Fusion Charts Factory Sample database as my guide. In both cases (with Factory Sample data and my own data) the first value in each data series are duplicated as the first and second data point, and the last value does not appear on the chart. My SQL query returns the following datasets $strQueryCategories Game R9,2015 R9,2015 R20,2015 R20,2015 EF,2015 R1,2016 R1,2016 $strQueryData Team Game Total Claremont R9,2015 60 Claremont R20,2015 60 Claremont EF,2015 61 Claremont R1,2016 110 East Perth R9,2015 21 East Perth R20,2015 70 East Perth EF,2015 93 East Perth R1,2016 34 // Form the SQL query $strQueryCategories = "SELECT CONCAT(RoundNo, ',',Season) AS Game FROM MatchDetails WHERE (Team = 'East Perth' OR Opponent = 'East Perth') AND (Team = 'Claremont' OR Opponent = 'Claremont') AND Season > 2014 ORDER BY GameID ASC"; $resultCategories = $dbhandle->query($strQueryCategories)or exit("Error code ({$dbhandle->errno}): {$dbhandle->error}"); $strQueryData = "SELECT Team, CONCAT(RoundNo, ',',Season) AS Game, Total FROM MatchDetails WHERE (Team = 'East Perth' OR Opponent = 'East Perth') AND (Team = 'Claremont' OR Opponent = 'Claremont') AND Season >2014 ORDER BY Team, GameId ASC"; $resultData = $dbhandle->query($strQueryData)or exit("Error code ({$dbhandle->errno}): {$dbhandle->error}"); if ($resultData) { $arrData = array( "chart" => array( "caption" => "Head to Head Since Start 2015", "subcaption" => "Scores For & Against", "theme" => "fint" ) ); $arrData["categories"] = array(array("category" => array())); if ($resultCategories) { $controlBreakValue = ""; while ($row = mysqli_fetch_array($resultCategories)) { if ($controlBreakValue != $row["Game"]) { $controlBreakValue = $row["Game"]; array_push( $arrData["categories"][0]["category"], array("label" => $controlBreakValue)); $controlBreakValue == ""; } } } $arrData["dataset"] = array(); $i = 0; if ($resultData) { $controlBreakValue = ""; while ($row = mysqli_fetch_array($resultData)) { if ($controlBreakValue != $row["Team"]) { $controlBreakValue = $row["Team"]; array_push($arrData["dataset"], array("seriesname" => $controlBreakValue, "data" => array(array("value" => $row["Total"])))); $controlBreakValue == ""; $i++; } array_push($arrData["dataset"][$i-1]["data"], array("value" => $row["Total"])); } } } $jsonEncodedData = json_encode($arrData); $dbhandle->close(); echo $jsonEncodedData; ?> <html> <body> <?php $columnChart = new FusionCharts("msline", "myFirstChart" , 850, 300, "chart-1", "json", $jsonEncodedData); $columnChart->render(); ?> <div id="chart-1"><!-- Fusion Charts will render here--></div> </body> </html> Chart output is attached. You can see the first value is duplicated. -
Halo, Can Somebody help me for make example multiple series using JSON in PHP Framework Codeigniter with MySQL, Not using XML but JSON. Please can someone to help me.
-
- multiple series
- php
-
(and 3 more)
Tagged with:
-
Use of variable for providing dataSource in fusioncharts
navaneeswar posted a topic in Javascript Problems
var arrcolor = ["00ff00", "800080", "ffa500", "ff0000"]; var count = data.length; for(var i=0;i<count;i++) { var obj = { label : data.Description, value : data.Value, link : "JavaScript: AnalysisByDrillDownLaceScoreGraph(" + data.Description + ")", color : arrcolor } data_array.push(obj); } var objJSON = { chart : { "bgcolor": "ffffff", "xAxisName": "Range", "yAxisName": "Count", "formatnumber": "1", "formatnumberscale": "6", "sformatnumber": "1", "showplotborder": "0", "canvasborderalpha": "0", "theme": "zune" }, data : (data_array) }; var newdata = JSON.stringify(objJSON); var AnalysisChart = new FusionCharts({ type: 'mscolumn2d', renderAt: 'divChartAnalysis', width: '110%', height: '250', dataFormat: 'json', dataSource: newdata }); AnalysisChart.render(); This is how i prepared the chart . the newdata is as follows newdata = {"chart":{"bgcolor":"ffffff","xAxisName":"Range","yAxisName":"count","formatnumber":"1","formatnumberscale":"6", sformatnumber":"1", "showplotborder":"0","canvasborderalpha":"0","theme":"zune"},"data":[{"label":"0-4","value":426,"color":"00ff00"},{"label":"5-9","value":2655,"color":"800080"},{"label":"10-14","value":1808,"color":"ffa500"},{"label":"15-19","value":45,"color":"ff0000"}]} Yet the fusionChart is displaying no data to display.. Pls someone help me with this. the state of dataready is shown as false. -
I'm using a 2D Stacked area chart with a json data source similar to the example below (but with a lot more dates). I'd like to add a drop-down menu on the page that filters the data by date range. Any suggestions on the best way to do this? Thanks, { "graph": { "caption": "My Chart" }, "categories": [ { "category": [ {"name": "01/10/2007","showname": "1"}, ..... {"name": "10/15/2014","showname": "0"} ] } ], "dataset": [ { "seriesname": "First Series", "data": [ {"value": "771569"}, ... {"value": "358887"} ] }, { "seriesname": "Second Series", "data": [ {"value": "7347"}, ... {"value": "12596"} ] }, { "seriesname": "Third Series", "data": [ {"value": "40857"}, ... {"value": "0"} ] } ] }
-
{ "response": { "version":"0.1", "termsofService":"http://www.wunderground.com/weather/api/d/terms.html", "features": { "conditions": 1 } } , "current_observation": { "image": { "url":"http://icons-ak.wxug.com/graphics/wu2/logo_130x80.png", "title":"Weather Underground", "link":"http://www.wunderground.com" }, "display_location": { "full":"Yorktown, VA", "city":"Yorktown", "state":"VA", "state_name":"Virginia", "country":"US", "country_iso3166":"US", "zip":"23690", "magic":"1", "wmo":"99999", "latitude":"37.22531891", "longitude":"-76.52363586", "elevation":"28.00000000" }, "observation_location": { "full":"York County, Virginia, Yorktown, Virginia", "city":"York County, Virginia, Yorktown", "state":"Virginia", "country":"US", "country_iso3166":"US", "latitude":"37.182751", "longitude":"-76.470512", "elevation":"8 ft" }, "estimated": { }, "station_id":"KVAYORKT2", "observation_time":"Last Updated on March 23, 5:51 PM EDT", "observation_time_rfc822":"Sun, 23 Mar 2014 17:51:27 -0400", "observation_epoch":"1395611487", "local_time_rfc822":"Sun, 23 Mar 2014 17:52:07 -0400", "local_epoch":"1395611527", "local_tz_short":"EDT", "local_tz_long":"America/New_York", "local_tz_offset":"-0400", "weather":"Light Rain", "temperature_string":"37.2 F (2.9 C)", "temp_f":37.2, "temp_c":2.9, "relative_humidity":"93%", "wind_string":"From the NNE at 3.0 MPH Gusting to 7.0 MPH", "wind_dir":"NNE", "wind_degrees":22, "wind_mph":3.0, "wind_gust_mph":"7.0", "wind_kph":4.8, "wind_gust_kph":"11.3", "pressure_mb":"1017", "pressure_in":"30.03", "pressure_trend":"0", "dewpoint_string":"35 F (2 C)", "dewpoint_f":35, "dewpoint_c":2, "heat_index_string":"NA", "heat_index_f":"NA", "heat_index_c":"NA", "windchill_string":"37 F (3 C)", "windchill_f":"37", "windchill_c":"3", "feelslike_string":"37 F (3 C)", "feelslike_f":"37", "feelslike_c":"3", "visibility_mi":"6.0", "visibility_km":"9.7", "solarradiation":"56", "UV":"0","precip_1hr_string":"-999.00 in ( 0 mm)", "precip_1hr_in":"-999.00", "precip_1hr_metric":" 0", "precip_today_string":"0.11 in (3 mm)", "precip_today_in":"0.11", "precip_today_metric":"3", "soil_temp_f": "0.0", "soil_moisture": "0.0", "leaf_wetness": "0.0", "icon":"rain", "icon_url":"http://icons-ak.wxug.com/i/c/k/rain.gif", "forecast_url":"http://www.wunderground.com/US/VA/Yorktown.html", "history_url":"http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=KVAYORKT2", "ob_url":"http://www.wunderground.com/cgi-bin/findweather/getForecast?query=37.182751,-76.470512" } } I've been reading and trying for about 5 days now, to learn about populating charts with data pulled from a source and I give up. I consider myself to be a less than fair at coding but I try to take things I find on this forum and other places and piece them together to make something work. So far I have failed miserably. I am trying to produce a single chart (Single Series Column 2D or anything) that displays temperature for my area. I would like to pull the temperature from a local WUNDERGROUND spot for display on a Dashboard I am creating. The data for the other charts on my Dashboard are static .xml files and they all work well. Where I need help is writing the code for a SSC2D chart using the data I pull using the WUNDERGROUND json file. Above is the json file. The data I need for the VALUE is under "current_observation" "temp_f". I would truly appreciate any help you could offer. I am a registered owner of FusionCharts XT and therefore would like to use a chart from that package. Once again, Thanks! Rudy
-
Due to a system limitation, I can only produce in JSON "dataset":[{"label":"Desktop","seriesname":"A","value":"335000"}] instead of the below in the documentation. Anyway to configure it so that it will take the figures similar to my ideal case? Can someone suggest a workaround for me? This is for MariMekko chart and I'm new to FusionCharts. Thanks in advance. "categories":[{ "category":[{ "label":"Desktop" }, { "label":"Laptop" }, { "label":"Notebook" } ] } ], "dataset":[{ "seriesname":"A", "data":[{ "value":"335000" }, { "value":"225100" }, { "value":"164200" } ] }, { "seriesname":"B", "data":[{ "value":"245000" }, { "value":"198000" }, { "value":"120000" } ] }, { "seriesname":"C", "data":[{ "value":"298000" }, { "value":"109300" }, { "value":"153600" }
-
Hello, I have a MSLine chart using validated JSON. This works fine using the flash but when I try to render it in javascript it errors. If I use myChart.setJSONUrl("ReceiptsMSLine.json"); I get invalid data error If i use myChart.setJSONData('MyJson'); I get the error: Line: 15 Error: Unable to get value of the property 'split': object is null or undefined Any help would be greatly appreciated. code is below: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Financial Chart</title> <script src="../../Charts/FusionCharts_EnterpriseEx/Charts/FusionCharts.js" type="text/javascript"></script> <script src="../../Charts/FusionCharts_EnterpriseEx/Charts/jquery.min.js" type="text/javascript"></script> <script src="../../Charts/FusionCharts_EnterpriseEx/Charts/highcharts.js" type="text/javascript"></script> </head> <body> <div id="wrapper"> <div id="chartContainer">FusionCharts will load here</div> <script type="text/javascript"><!-- FusionCharts.setCurrentRenderer('javascript'); var myChart = new FusionCharts("../../Charts/FusionCharts_EnterpriseEx/Charts/MSLine.swf", "ChartId", "800", "500", "0", "0"); //myChart.setJSONUrl("ReceiptsMSLine.json"); myChart.setJSONData('{"chart":{ "caption":"Receipts - cumulative", "xaxisname":"Month", "yaxisname":"Receipts £", "showvalues":"0", "numberprefix": "%A3", "bgColor":"ffffff", "showBorder":"0","numVDivLines":"10","reverseLegend":"1"},"categories":[{"category":[{"label":"Apr"},{"label":"May"},{"label":"Jun"},{"label":"Jul"},{"label":"Aug"},{"label":"Sep"},{"label":"Oct"},{"label":"Nov"},{"label":"Dec"},{"label":"Jan"},{"label":"Feb"},{"label":"Mar"}]}],"dataset":[{"seriesname":"Monthly Plan","color": "af292e","data":[{"value":"9378010"},{"value":"71026533"},{"value":"90101266"},{"value":"97825351"},{"value":"103616222"},{"value":"117813441"},{"value":"128052071"},{"value":"136053732"},{"value":"149482740"},{"value":"156552766"},{"value":"162577528"},{"value":"313978555"}]},{"seriesname":"DEL Forecast","color":"00857e","dashed":"1","data":[{"value":""},{"value":""},{"value":""},{"value":""},{"value":""},{"value":""},{"value":""},{"value":""},{"value":"211006263"},{"value":"230506969"},{"value":"247861703"},{"value":"324894030"}]},{"seriesname":"Actual YTD","color":"00857e","data":[{"value":"8305075"},{"value":"69262137"},{"value":"84307885"},{"value":"99994631"},{"value":"119527041"},{"value":"142661942"},{"value":"160449790"},{"value":"180489689"},{"value":"211006263"},{"value":""},{"value":""},{"value":""}]}],"styles":[{"definition":[{"style":[{"name":"CanvasAnim","type":"animation","param":"_xScale","start":"0","duration":"1"}]}],"application":[{"apply":[{"toobject":"Canvas","styles":"CanvasAnim"}]}]}]}'); myChart.render("chartContainer" ); </script> </div> </body> </html>
-
Bug: JavaScript Culumn2D json showValues results in "Invalid Data"
Elger van Boxtel posted a topic in Bug Reports
Hi, I render a column2D chart through JavaScript, which works fine. If I add the showValues property to the chart element, then it results in a "Invalid Data" message. If I leave it, then it will render as expected. The showValues property is mentioned in the functional attributes under http://docs.fusioncharts.com/charts/contents/ChartSS/Column2D.html#Anchor1. "chart": { "caption": "Category wise Sales for 1996", "xaxisname": "Month", "palette": "2", "animation": "1", "formatnumberscale": "0", "numberprefix": "$", "showvalues": "0", "numdivlines": "4", "legendposition": "BOTTOM", "showValues":"0" } (Complete JSON attached Column2D.txt) Could you please take a look at this and notify me when this will be fixed. P.s. I am not allowed to upload .json files, so I've renamed it to .txt. -
Hi, Im trying to create a FusionMaps (version 3.2.1) map with JSON data: ... var map = new FusionCharts('fusioncharts/Maps/FCMap_World.swf', 'MapId', '900', '300', '0', '0'); map.setTransparent(true); map.setJSONData('{"map":{},"data":[{"id":"NA","value":"25"}]}'); map.render('mapdiv'); ... After running the script the map is shown without data. But when im running the same script with current evaluation version of FusionMaps (version 3.3.1) the data is diplayed correctly. Is there a bug in version 3.2.1 or is there any mistake in my JSON data string? Thanks, msch4711
- 1 reply
-
- FusionMaps
- JSON
-
(and 1 more)
Tagged with:
-
Hi, I created a sample radar chart with JSON value updated dynamically from MYSQL DB. I am unable to get interactive Legend (which is clickable).
- 1 reply
-
- Legend
- Powerchart
-
(and 2 more)
Tagged with:
-
Hi, We are working on RadarChart, dataset and cateogories are retrieved from JSON Data, We need to specify some datapoints to be highlighted. How this can be achived. Please help us immediately
- 1 reply
-
- Radarchart
- JSON
-
(and 2 more)
Tagged with: