I
I
Ilya Vegner2019-07-03 15:10:51
JavaScript
Ilya Vegner, 2019-07-03 15:10:51

How to add master-data for my graph?

I have a chart on which I display the data I need by day.
Here are the chart settings themselves:

this.chartOptions = {
        chart: {
          type: 'area',
        },
        title: {
          text: '',
        },
        xAxis: {
          categories: this.dates,
          tickmarkPlacement: 'on',
          title: {
            enabled: false,
          },
        },
        yAxis: {
          title: {
            text: '',
          },
          labels: {
            formatter() {
              return this.value;
            },
          },
        },
        tooltip: {
          split: true,
        },
        plotOptions: {
          area: {
            stacking: 'normal',
            lineColor: '#666666',
            lineWidth: 1,
            marker: {
              lineWidth: 1,
              lineColor: '#666666',
            },
          },
        },
        series: obj,
        responsive: {
          rules: [{
            condition: {
              maxWidth: 500,
            },
            chartOptions: {
              legend: {
                layout: 'horizontal',
                align: 'center',
                verticalAlign: 'bottom',
              },
            },
          }],
        },
      };

Here is the obj that is passed to series
[{
        id: '1',
        type: 'area',
        checked: true,
        name: 'Посты от пользователей',
        data: user_count,
        color: '#244363',
  }];

And the user_count array itself
[2, 0, 0, 0, 1, 1, 1, 0, 2, 1, 2, 1, 0, 3, 1, 1, 2, 1, 3, 1, 2, 0, 2, 1, 0, 1, 1, 1, 2, 7, 2]

I need to add a master-datail to the chart so that I can scale the chart like in the picture
5d1c9b15b1dd1054764628.png
. But I can’t figure out the highcharts api and nothing happens, can someone tell me how to do it in my case?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question