Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete examples #32

Closed
jimfilippou opened this issue Aug 13, 2018 · 2 comments
Closed

Incomplete examples #32

jimfilippou opened this issue Aug 13, 2018 · 2 comments

Comments

@jimfilippou
Copy link
Contributor

Under this link https://apexcharts.com/javascript-chart-demos/line-charts/zoomable-timeseries/

there is this code

 var ts2 = 1484418600000;
    var dates = [];
    var spikes = [5, -5, 3, -3, 8, -8]
    for (var i = 0; i < 120; i++) {
      ts2 = ts2 + 86400000;
      var innerArr = [ts2, dataSeries[1][i].value];
      dates.push(innerArr)
    }

    var options = {
      chart: {
        type: 'area',
        stacked: false,
        height: 380,
        zoom: {
          enabled: true
        },
      },
      plotOptions: {
        line: {
          curve: 'smooth',

        }
      },
      dataLabels: {
        enabled: false
      },
      series: [{
        name: 'XYZ MOTORS',
        data: dates
      }],
      markers: {
        size: 0,
        style: 'full',
      },
      //colors: ['#0165fc'],
      title: {
        text: 'Stock Price Movement',
        align: 'left'
      },
      fill: {
        gradient: {
          enabled: true,
          shadeIntensity: 1,
          inverseColors: false,
          opacityFrom: 0.35,
          opacityTo: 0,
          stops: [0, 70, 80, 100]
        },
      },
      yaxis: {
        min: 20000000,
        max: 250000000,
        labels: {
          formatter: function (val) {
            return (val / 1000000).toFixed(0);
          },
        },
        title: {
          text: 'Price'
        },
      },
      xaxis: {
        type: 'datetime',
      },

      tooltip: {
        shared: false,
        y: {
          formatter: function (val) {
            return (val / 1000000).toFixed(0)
          }
        }
      }
    }

    var chart = new ApexCharts(
      document.querySelector("#chart"),
      options
    );

    chart.render();

Where is dataSeries[1][i].value defined?

@junedchhipa
Copy link
Contributor

The data for the examples on the website may come from external places.
If you want to access all examples with complete code, they are located at this place
https://github.com/apexcharts/apexcharts.js/tree/master/samples

@jimfilippou
Copy link
Contributor Author

You're awesome bro 💨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants