Click to Add Point Chart Tutorial With Examples

Today, We want to share with you Click to Add Point Chart Tutorial With Examples.In this post we will show you highcharts update chart type, hear for How to draw a lines based on click point in charts using higcharts with example we will give you demo and example for implement.In this post, we will learn about Highchart Click to Added Point Chart with an example.

Click to Add Point Chart Tutorial With Examples

There are the Following The simple About Chart with Point Addition Capability Full Information With Example and source code.

As I will cover this Post with live Working example to develop Use highcharts to create chart with clickable point to add markers example, so the Add point by *line* click, not chart click is used for this example is following below.

Read Also:  Angular Gauge Chart Tutorial With Examples

Highcharts Click to Add Point Chart Example

index.html

Angular is a platform for building mobile & desktop web Based user friendly and light weight applications.Angular,It’s TypeScript-based open-source Angularjs web application framework.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Highcharts - Click to Add Point Chart - www.pakainfo.com</title>
    <script src="https://www.pakainfo.com/jquery/js/jquery-1.12.4.js"></script>
    <script src="https://www.pakainfo.com/jquery/js/highcharts.js"></script>
    <script type="text/javascript">
        $(function () {
            var graphtype = {
                type: 'scatter',
                margin: [70, 50, 60, 80],
                events: {
                    click: function (e) {
                        // find the clicked values and the series
                        var x = e.xAxis[0].value,
                            y = e.yAxis[0].value,
                            series = this.series[0];
                        // Add it
                        series.addPoint([x, y]);
                    }
                }
            }
            var graphTitle = {
                text: 'User supplied data'
            }
            var graphchildtitle = {
                text: 'Click the plot area to add a point. Click a point to remove it.'
            }
            var graphxaxis = {
                gridLineWidth: 1,
                minPadding: 0.2,
                maxPadding: 0.2,
                maxZoom: 60
            }
            var graphyaxis = {
                title: {
                    text: 'Value'
                },
                minPadding: 0.2,
                maxPadding: 0.2,
                maxZoom: 60,
                plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#808080'
                }]
            }
            var graphplotoptions = {
                series: {
                    lineWidth: 1,
                    point: {
                        events: {
                            'click': function () {
                                if (this.series.data.length > 1) {
                                    this.remove();
                                }
                            }
                        }
                    }
                }
            }
            var graphlegend = {
                enabled: false
            }
            var chartexporting = {
                enabled: false
            }
            var graphseries = [{
                data: [[20, 20], [80, 80]]
            }]
            $('#chart-full-content').highcharts({
                chart: graphtype,
                title: graphTitle,
                subtitle:graphchildtitle,
                xAxis: graphxaxis,
                yAxis: graphyaxis,
                plotOptions: graphplotoptions,
                legend: graphlegend,
                exporting: chartexporting,
                series: graphseries
            });
        });
    </script>
</head>
<body>
    <div id="chart-full-content" style="min-width: 335px; height: 425px; margin: 0 auto"></div>
</body>
</html>

Web Programming Tutorials Example with Demo

Read :

Read Also:  Column with Drilldown Chart Tutorial With Examples

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about highcharts addpoint example.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.