метки на точках и прямо на линиях - PullRequest
0 голосов
/ 19 сентября 2019

Доброе утро, я хочу показать метки значений в каждой точке и чтобы они также отображались в левой части графика, вы можете мне помочь.

      <script>
anychart.onDocumentReady(function () {
    // create data set on our data
    var dataSet = anychart.data.set([
      ['Ambiente de trabajo', 0, <?php echo $sumatoriaCatsuper;?>],
      ['Factores propios de la actividad', 0, <?php echo $sumatoriaCatsuper2;?>],
      ['Organización del tiempo de trabajo', 0, <?php echo $sumatoriaCatsuper3;?>],
      ['Liderazgo y relaciones en el trabajo', 0, <?php echo $sumatoriaCatsuper4;?>],
      ['Entorno organizacional', 0, <?php echo $sumatoriaCatsuper5;?>]
    ]);
    // create bar chart
    var chart = anychart.bar();
    // set chart padding
    chart.padding([10, 40, 5, 20])
            // set chart title text settings
            .title('Categoría');
    // map data for the second series, take x from the zero column and value from the second column of data set
    var seriesLineData = dataSet.mapAs({'x': 0, 'value': 2});
    // create line series with passed data
    var seriesLine = chart.line()
            .name('Puntaje')
            .data(seriesLineData)
            .stroke('3 #f18126');
    // set markers settings
    seriesLine.markers()
            .enabled(true)
            .size(5);
                //options
    // set titles for axises
    chart.xAxis().title('');
    chart.yAxis().title('Puntuación');
    chart.interactivity().hoverMode('by-x');
    chart.tooltip()
            .position('right')
            .anchor('left-top')
            .displayMode('union')
            .titleFormat(function () {
                return this.points[0]['x'] + ' age'
            })
            .unionFormat(function () {
                var result = '';

                for (var i = 0; i < this.points.length; i++) {
                    result += this.points[i]['seriesName'] + ': ' + this.points[i]['value'];
                    if (i < this.points.length - 1) {
                        result += '\n';
                    }
                }
                return result
            });
    // set scale minimum/maximum
    chart.yScale().minimum(0);
    chart.yScale().maximum(100);

    // set container id for the chart
    chart.container('container');
    // initiate chart drawing
    chart.draw();

var options= {
                line: {
                    dataLabels: {
                        enabled: true,
                        inside: true,
                        align: 'left',
                        x: 390
                    }
                }
            }

});
</script>

просто показать метки в каждой точке иэто метки значений справа от диаграммы.

Я проверял некоторые plotOptions, но не могу найти решение, я был бы очень признателен, так как работа с этим графиком стала слишком сложной для меня.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...