Highcharts: edit data label style in css file

Is there a way to select a class highcharts-data-label

and change the font size and color of the data labels like in the example below?

<g class="highcharts-data-labels highcharts-tracker" visibility="visible" zIndex="6" transform="translate(42,10) scale(1 1)" style="">
    <g zIndex="1" style="cursor:default;" transform="translate(54,146)">
        <text x="3" y="15" style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:11px;font-weight:normal;color:#2f7ed8;fill:#2f7ed8;" zIndex="1">
            <tspan x="3">0.8</tspan>
        </text>
    </g>
</g>

      

I am using software that automatically generates tall charts and minifies js files, so if I could do this in a css file, I would override the default behavior for all generated charts.

+3


source to share


1 answer


add this to your tall charts code to change the labels to green (you can change them to any color). See fiddle for a demo



labels: {
         formatter: function () {
                     {
                        return '<span style="fill: green;">' + this.value + '</span>';
                    }
                }
            }

      

+3


source







All Articles