How to splice a dual-axis graph in the JSON format of FusionCharts, fusionchartsjson

Source: Internet
Author: User

How to splice a dual-axis graph in the JSON format of FusionCharts, fusionchartsjson

1. Problem background

Assume that a problem occurs in the project: Use the JSON format in FusionCharts to splice a dual-axis graph, convert the JSON string into a JSON object, and transmit it to the foreground, which is displayed on the page.


2. Design source code

/***** @ Title: DoubleYaxis. java * @ Package: com. you. utils * @ Description: 

Running result:

FusionChart dual-axis diagram of multiple series charts: {"chart": {"caption": "sales distribution in December", "xaxisname": "month", "yaxisname": "sales ", "showvalues": "0"}, "categories": [{"category": [{"label": "January" },{ "label": "February "}, {"label": "March" },{ "label": "April" },{ "label": "May" },{ "label": "June "}, {"label": "July" },{ "label": "August" },{ "label": "September" },{ "label": "October "}, {"label": "November" },{ "label": "December"}], "dataset": [{"seriesname": "apple ", "data": [{"value": "100" },{ "value": "200" },{ "value": "300" },{ "value ": "400" },{ "value": "500" },{ "value": "600" },{ "value": "700" },{ "value ": "800" },{ "value": "900" },{ "value": "1000" },{ "value": "1100" },{ "value ": "1200"}] },{ "seriesname": "orange", "parentyaxis": "S", "data": [{"value": "200 "}, {"value": "400" },{ "value": "600" },{ "value": "800" },{ "value": "1000 "}, {"value": "1200" },{ "value": "1400" },{ "value": "1600" },{ "value": "1800 "}, {"value": "2000" },{ "value": "2200" },{ "value": "2400"}]}

3. After formatting

{"Chart": {"caption": "2014 sales distribution", "xaxisname": "sales", "yaxisname": "People", "showvalues ": "0"}, "categories": [{"category": [{"label": "January" },{ "label": "February "}, {"label": "March" },{ "label": "April" },{ "label": "May" },{ "label": "June "}, {"label": "July" },{ "label": "August" },{ "label": "September" },{ "label": "October "}, {"label": "November" },{ "label": "December"}], "dataset": [{"seriesname": "apple ", "data": [{"value": "100" },{ "value": "200" },{ "value": "300" },{ "value ": "400" },{ "value": "500" },{ "value": "600" },{ "value": "700" },{ "value ": "800" },{ "value": "900" },{ "value": "1000" },{ "value": "1100" },{ "value ": "1200"}] },{ "seriesname": "orange", "parentyaxis": "S", "data": [{"value": "200 "}, {"value": "400" },{ "value": "600" },{ "value": "800" },{ "value": "1000 "}, {"value": "1200" },{ "value": "1400" },{ "value": "1600" },{ "value": "1800 "}, {"value": "2000" },{ "value": "2200" },{ "value": "2400"}]}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.