Loading
Creating Error Scatter Chart
An error scatter chart is an XY plot chart with vertical and horizontal error bars to show a range of error values for a specific data value.
In this section you will be shown how you can:
-
Create a simple error scatter chart
-
Customize the vertical and horizontal error bars
Creating a Simple Error Scatter Chart
As an example, we will create a simple error scatter chart that shows the revenue forecast for the next year.
An error scatter chart thus created looks like this:
Given below is a brief description of the attributes used to create an error scatter chart:
Attribute | Description |
---|---|
|
It is used to specify the label for the data item. The label is rendered on the x-axis. This attribute belongs to the |
|
In the error scatter chart, the position of a datapoint is defined in the form of two numeric parameters, one from the y-axis and the other from the x-axis. |
|
When used with the |
|
It is used to specify the numeric |
|
It is used to specify the radius of the anchor that represents the data point. |
|
It is used to specify the hex code of the color that will be used to render the anchor that represents the data point. |
|
It is used to specify the range of possible vertical deviation values that will be plotted as the error bar on the chart. This attribute belongs to the |
The data structure for creating the above chart is given below :
{
"chart": {
"xaxisname": "Month",
"yaxisname": "Revenue (In USD)",
"caption": "Revenue forecast",
"subcaption": "For Next Year",
"halfverticalerrorbar": "0",
"showlegend": "0",
"bgColor": "#ffffff",
"showBorder": "0",
"numberPrefix": "$",
"showCanvasBorder": "0",
"showAlternateHGridColor": "0",
"baseFontColor": "#333333",
"baseFont": "Helvetica Neue,Arial",
"captionFontSize": "14",
"subcaptionFontSize": "14",
"subcaptionFontBold": "0",
"toolTipColor": "#ffffff",
"toolTipBorderThickness": "0",
"toolTipBgColor": "#000000",
"toolTipBgAlpha": "80",
"toolTipBorderRadius": "2",
"toolTipPadding": "5",
"divlineAlpha": "100",
"divlineColor": "#999999",
"divlineThickness": "1",
"divLineIsDashed": "1",
"divLineDashLen": "1",
"divLineGapLen": "1"
},
"categories": [
{
"category": [
{
"label": "Jan",
"x": "20"
},
{
"label": "Feb",
"x": "30"
},
{
"label": "Mar",
"x": "40"
},
{
"label": "Apr",
"x": "50"
},
{
"label": "May",
"x": "60"
},
{
"label": "Jun",
"x": "70"
},
{
"label": "Jul",
"x": "80"
},
{
"label": "Aug",
"x": "90"
},
{
"label": "Sep",
"x": "100"
},
{
"label": "Oct",
"x": "110"
},
{
"label": "Nov",
"x": "120"
},
{
"label": "Dec",
"x": "130"
}
]
}
],
"dataset": [
{
"seriesname": "This Year",
"color": "",
"anchorradius": "8",
"anchorbgcolor": "#1aaf5d",
"data": [
{
"y": "450000",
"x": "20",
"verticalErrorValue": "50000"
},
{
"y": "860000",
"x": "30",
"verticalErrorValue": "69000"
},
{
"y": "750000",
"x": "40",
"verticalErrorValue": "69000"
},
{
"y": "570000",
"x": "50",
"verticalErrorValue": "60000"
},
{
"y": "910000",
"x": "60",
"verticalErrorValue": "50000"
},
{
"y": "580000",
"x": "70",
"verticalErrorValue": "55000"
},
{
"y": "610000",
"x": "80",
"verticalErrorValue": "87000"
},
{
"y": "620000",
"x": "90",
"verticalErrorValue": "45000"
},
{
"y": "520000",
"x": "100",
"verticalErrorValue": "59000"
},
{
"y": "530000",
"x": "110",
"verticalErrorValue": "72000"
},
{
"y": "950000",
"x": "120",
"verticalErrorValue": "69000"
},
{
"y": "770000",
"x": "130",
"verticalErrorValue": "69000"
}
]
}
]
}
<chart xaxisname="Month" yaxisname="Revenue (In USD)" caption="Revenue forecast" subcaption="For Next Year" halfverticalerrorbar="0" showlegend="0" bgcolor="#ffffff" showborder="0" numberprefix="$" showcanvasborder="0" showalternatehgridcolor="0" basefontcolor="#333333" basefont="Helvetica Neue,Arial" captionfontsize="14" subcaptionfontsize="14" subcaptionfontbold="0" tooltipcolor="#ffffff" tooltipborderthickness="0" tooltipbgcolor="#000000" tooltipbgalpha="80" tooltipborderradius="2" tooltippadding="5" divlinealpha="100" divlinecolor="#999999" divlinethickness="1" divlineisdashed="1" divlinedashlen="1" divlinegaplen="1">
<categories>
<category label="Jan" x="20" />
<category label="Feb" x="30" />
<category label="Mar" x="40" />
<category label="Apr" x="50" />
<category label="May" x="60" />
<category label="Jun" x="70" />
<category label="Jul" x="80" />
<category label="Aug" x="90" />
<category label="Sep" x="100" />
<category label="Oct" x="110" />
<category label="Nov" x="120" />
<category label="Dec" x="130" />
</categories>
<dataset seriesname="This Year" color="" anchorradius="8" anchorbgcolor="#1aaf5d">
<set y="450000" x="20" verticalerrorvalue="50000" />
<set y="860000" x="30" verticalerrorvalue="69000" />
<set y="750000" x="40" verticalerrorvalue="69000" />
<set y="570000" x="50" verticalerrorvalue="60000" />
<set y="910000" x="60" verticalerrorvalue="50000" />
<set y="580000" x="70" verticalerrorvalue="55000" />
<set y="610000" x="80" verticalerrorvalue="87000" />
<set y="620000" x="90" verticalerrorvalue="45000" />
<set y="520000" x="100" verticalerrorvalue="59000" />
<set y="530000" x="110" verticalerrorvalue="72000" />
<set y="950000" x="120" verticalerrorvalue="69000" />
<set y="770000" x="130" verticalerrorvalue="69000" />
</dataset>
</chart>
Customizing the Error Bar
You can customize the cosmetic properties of error bars to change their appearance.
An error scatter chart, after customizing the error bars, looks like this :
Given below is a brief description of the attributes used to customize the error bars::
Attribute | Description |
---|---|
|
It is used to specify whether vertical error bars (half/full) will be shown for the error scatter chart. Setting this attribute to |
|
It is used to specify whether half or full vertical error bars will be shown for the error scatter chart. Setting this attribute to |
|
It is used to specify the hex code of the color used to render the vertical error bars. |
|
It is used to specify the hex code of the color used to render the error bars. |
|
It is used to specify the transparency of the vertical error bars. This attribute takes values between 0 (transparent) and 100 (opaque). |
|
It is used to specify the transparency of the error bars. This attribute takes values between 0 (transparent) and 100 (opaque). |
|
It is used to specify the thickness, in pixels, of the vertical error bars. |
|
It is used to specify the thickness, in pixels, of the error bars. |
|
It is used to specify the width, in pixels, of the vertical error bars. |
|
It is used to specify the width, in pixels, of the error bars. |
The data structure for creating the chart above is given below:
{
"chart": {
"theme": "fint",
"xaxisname": "Months",
"yaxisname": "Revenue (In $)",
"caption": "Revenue forecast",
"subcaption": "Next Year",
"halfverticalerrorbar": "0",
"verticalErrorBarColor": "#990000",
"verticalErrorBarThickness": "2",
"verticalErrorBarAlpha": "50",
"verticalErrorBarWidth": "8"
},
"categories": [
{
"category": [
{
"label": "Jan",
"x": "20"
},
{
"label": "Feb",
"x": "30"
},
{
"label": "Mar",
"x": "40"
},
{
"label": "Apr",
"x": "50"
},
{
"label": "May",
"x": "60"
},
{
"label": "Jun",
"x": "70"
},
{
"label": "Jul",
"x": "80"
},
{
"label": "Aug",
"x": "90"
},
{
"label": "Sep",
"x": "100"
},
{
"label": "Oct",
"x": "110"
},
{
"label": "Nov",
"x": "120"
},
{
"label": "Dec",
"x": "130"
}
]
}
],
"dataset": [
{
"color": "",
"anchorradius": "8",
"anchorbgcolor": "#7ed37e",
"data": [
{
"y": "450000",
"x": "20",
"verticalErrorValue": "50000"
},
{
"y": "860000",
"x": "30",
"verticalErrorValue": "69000"
},
{
"y": "750000",
"x": "40",
"verticalErrorValue": "69000"
},
{
"y": "570000",
"x": "50",
"verticalErrorValue": "60000"
},
{
"y": "910000",
"x": "60",
"verticalErrorValue": "50000"
},
{
"y": "580000",
"x": "70",
"verticalErrorValue": "55000"
},
{
"y": "610000",
"x": "80",
"verticalErrorValue": "87000"
},
{
"y": "620000",
"x": "90",
"verticalErrorValue": "45000"
},
{
"y": "520000",
"x": "100",
"verticalErrorValue": "59000"
},
{
"y": "530000",
"x": "110",
"verticalErrorValue": "72000"
},
{
"y": "950000",
"x": "120",
"verticalErrorValue": "69000"
},
{
"y": "770000",
"x": "130",
"verticalErrorValue": "69000"
}
]
}
]
}
<chart theme="fint" xaxisname="Months" yaxisname="Revenue (In $)" caption="Revenue forecast" subcaption="Next Year" halfverticalerrorbar="0" verticalerrorbarcolor="#990000" verticalerrorbarthickness="2" verticalerrorbaralpha="50" verticalerrorbarwidth="8">
<categories>
<category label="Jan" x="20" />
<category label="Feb" x="30" />
<category label="Mar" x="40" />
<category label="Apr" x="50" />
<category label="May" x="60" />
<category label="Jun" x="70" />
<category label="Jul" x="80" />
<category label="Aug" x="90" />
<category label="Sep" x="100" />
<category label="Oct" x="110" />
<category label="Nov" x="120" />
<category label="Dec" x="130" />
</categories>
<dataset color="" anchorradius="8" anchorbgcolor="#7ed37e">
<set y="450000" x="20" verticalerrorvalue="50000" />
<set y="860000" x="30" verticalerrorvalue="69000" />
<set y="750000" x="40" verticalerrorvalue="69000" />
<set y="570000" x="50" verticalerrorvalue="60000" />
<set y="910000" x="60" verticalerrorvalue="50000" />
<set y="580000" x="70" verticalerrorvalue="55000" />
<set y="610000" x="80" verticalerrorvalue="87000" />
<set y="620000" x="90" verticalerrorvalue="45000" />
<set y="520000" x="100" verticalerrorvalue="59000" />
<set y="530000" x="110" verticalerrorvalue="72000" />
<set y="950000" x="120" verticalerrorvalue="69000" />
<set y="770000" x="130" verticalerrorvalue="69000" />
</dataset>
</chart>
There! You have now seen how you can create an error scatter chart and customize the error bars.