score:2
it doesn't matter that you have categories on the x axis, as far as the scatter plot is concerned - your x values are the array index of the categories (0-5 in the case of your image).
there is a plugin to auto calculate a regression line, here:
or, you can calculate your own and plot it normally.
however, a regression line through a group of categories doesn't make much sense. i don't see how it can tell you anything useful, and is probably more likely to cause confusion or outright misunderstanding.
this seems to me to be data that would be more appropriate to plot with a bar chart than a scatter plot.
fwiw
{{edit:
after looking at this longer, i am somewhat unclear: is that actually a regression line, or is that an average, or a target...?
if that's the case, you can either plot it is a line series, or you can use plotlines:
example with a plotline
:
score:2
the chart like this is very easily done using amcharts regular serial chart with line graph with bullets (bullet: "diamond"
) and no line (linealpha: 0
).
var chart = amcharts.makechart( "chartdiv", {
"type": "serial",
"dataprovider": [ {
"category": "civil",
"value": 0.87
}, {
"category": "piping",
"value": 1.1
}, {
"category": "mechanical",
"value": 0.69
}, {
"category": "electrical",
"value": 0.82
}, {
"category": "insulation",
"value": 1.42
}, {
"category": "completion",
"value": 1.1
} ],
"valueaxes": [ {
"guides": [{
"value": 1,
"linealpha": 1,
"linethickness": 2,
"linecolor": "#f00"
}]
} ],
"startduration": 1,
"graphs": [ {
"linealpha": 0,
"bullet": "diamond",
"valuefield": "value",
"linecolor": "#5782bf"
} ],
"chartcursor": {
"categoryballoonenabled": false,
"cursoralpha": 0,
"zoomable": false
},
"categoryfield": "category",
"categoryaxis": {
"gridposition": "start",
"gridalpha": 0,
"tickposition": "start"
}
} );
<script src="http://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="http://www.amcharts.com/lib/3/serial.js"></script>
<div id="chartdiv" style="width: 600px; height: 200px;"></div>
Source: stackoverflow.com
Related Query
- how to make a scatter with regression line graph in amcharts / highcharts?
- Highcharts : How do I keep the marker formatting and make the click event fire with a 5K+ point scatter plot?
- How can I make a graph with highcharts from csv file?
- Highcharts - How to make a scatter plot with multiple series from HTML table
- How to make legend color show up in Highcharts for a line graph under certain conditions?
- How to make the regression line through the origin in highcharts
- how to make chart real time with 2 line and get data from php with highcharts
- HIGHCHARTS How to to make separate colors for shaded region and the line in Area Graph
- How to get 2 data-points with one name in series Line Graph Highcharts Reactjs
- How do I set highcharts line graph point colors to an array of colors?
- Highcharts - Scatter chart with a line connecting the dots in the series
- Creating a line graph with highcharts and data in an external csv
- Highcharts scatter plot with variable line width
- How can I force ticks/grid lines on a Highcharts datetime X axis to arbitrarily line up with data points?
- Custom Marker (Rectangle with rounded corner) for highcharts scatter graph
- How To Call A Function To Make A Graph Using HighCharts in PHP
- HighCharts & MVC: How to load whole graph definition and data with JSON?
- How to display line break for irregular time series with highcharts
- How to create a single series bar graph with Highcharts
- How can I make milestone lines with a GANTT chart using the highcharts library?
- How do I use dates from a LinkedHashMap for the x-axis on a Highcharts line graph (using Thymeleaf)?
- how to continue the graph line when missing series of data in middle of highcharts
- Highchart : How to plot Stacked bar graph with line by below JSON respons
- How to add vertical (and horizontal) line in highcharts scatter plot
- How to draw a line on a highcharts graph from an AJAX call?
- How to change Highcharts graph with HTML radio button input (JS/jQuery)
- How to make highcharts with dynamic datetime range with monthly interval
- How to make split grouped column bar chart in highcharts with percentage?
- How to hide series name from tooltip in Highcharts scatter plots for linear regression
- Highcharts - XAxis Label with LineFeed - how to make smaller gap?
More Query from same tag
- HighCharts.js TickInterval dynamic change
- MSSQL Server to PHP Array to JSON Encode to Highcharts
- How to curve every data labels along the individual segments in Sunburst chart?
- How to start highchart column chart from left most corner of x-axis?
- Highcharts - Can't change line colors
- Codeigniter highcharttable count how many data in a month
- Displaying data into a graph in web service ASP.NET MVC Framework
- Control spacing and height between bars in Highcharts.js bar chart
- How can we add chart context menu in highcharts-angular?
- Position highcharts datalabels to the left of positive bars and to the right of negative bars
- How to show 0 for incomplete Series in Highcharts
- Display 100 Points in 1 second : Highcharts
- Invert axis on highchart diagram with data from table
- Can the lines in Highcharts appear one after the other?
- Two DataSeries for yAxis 1 and 2 with Data from SQLdb
- Links in Y-Axis of stacked bar chart
- Create new value in legend for 2nd and 3rd drilldown
- add point to new series of some specific category
- Apache Zeppelin - Highcharts
- Highchart date quarter view on axis
- Highchart Options (points' size) - R shiny
- Highcharts - Is there a chart similar to full donut
- Filtering legend of a Highcharts by only visible series only in Export
- Background columns in linechart highchart
- How Can I Make Responsive Titles In Highcharts?
- How to expand the Connector of ORG Chart
- How to implement HighChart thousandsSep() for android(JAVA) on Hi-chart WordCloud
- Highcharts in a modal window on click
- Highstock: When legend under the chart has many items, the chart height is small. How can I fix the height?
- Negative and positive in same direction in highchart