Jump to content
  • 0

Pie Charts | How to style Data Labels


Altair

Question

1 answer to this question

Recommended Posts

  • 0

You can use CSS to style it:
You will put this on your header.
 

<style>
tspan.highcharts-text-outline {
  stroke: red !important;
}
</style>



You can also try to modify it via JS using HighChart API

Put this on your header:

<script src="https://code.jquery.com/jquery-3.2.1.js"></script>
<script src="https://code.jquery.com/jquery-migrate-3.0.0.js"></script>

Footer:

<script type="text/javascript">
jQuery(window).load(function() {
  Highcharts.charts[0].update({
      series: {

        dataLabels: {
          style: {
            color: "black",
            fontSize: 20,
            textOutline: "none"
          }
        }
      }
    }

  );


});
</script>

image.png.61496bef5a62d0a29a84fc9008961fe4.png
You may refer to this link for more information: https://api.highcharts.com/highcharts/series.pie.dataLabels.style

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...