Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9205341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:55:44+00:00 2026-06-17T23:55:44+00:00

I want to create a graph stacked column using Highcharts plugin with the data

  • 0

I want to create a graph “stacked column” using Highcharts plugin with the data in a XML file. (See here)
My XML file is:

<?xml version="1.0" encoding="utf-8"?>
<chart>
<categories>
<item>2000</item>
<item>2001</item>
<item>2002</item>
....    </categories>
<series>
<name>Impots locaux</name>
<data>
<point>231</point>
<point>232</point>
....    </data>
</series>
<series>
<name>Autres impots et taxes</name>
<data>
<point>24</point>
<point>27</point>
<point>37</point>
.....</data>
</series>
<series>
<name>Dotation globale de fonctionnement</name>
<data>
<point>247</point>
<point>254</point>
....</data>
</series>
</chart>

The HTML coding is:

<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Mazet</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
    <script type="text/javascript" src="../js/highcharts.js"></script>
    <script type="text/javascript" src="../js/themes/gray.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {


        var options = {
            chart: {
                renderTo: 'container',
                type: 'column'
            },
            title: {
                text: 'Produits de fonctionnement du Mazet-Saint-Voy'
            },
              subtitle: {
            text: 'Source : <a href="http://alize22.finances.gouv.fr/communes/eneuro/RDep.php?type=BPS&dep=043" target="_blank">Ministère de l\'économie et des finances</a>'
        },
        tooltip: {
            formatter: function () {
                return '' + this.y +  ' €/hab. en ' +  this.x;
            }
        },

        plotOptions: {
            column: {
               /* pointPadding: 0.2,
                borderWidth: 0,*/
                   stacking: 'normal',
                dataLabels: {
                    enabled: true,
                    color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
                }
            }
        },
            xAxis: {
                categories: [],
                   labels: {
                rotation: -45,
                align: 'right',
                style: {
                    fontSize: '13px',
                    fontFamily: 'Verdana, sans-serif'
                }
            }

            },
            yAxis: {
                title: {
                    text: 'En euros par habitant'
                },
            stackLabels: {
                enabled: true,
                style: {
                    fontWeight: 'bold',
                    color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
                }
            }
        },
            series: []
        };

        // Load the data from the XML file 
        $.get('../xml/43130.xml', function(xml) {

            // Split the lines
            var $xml = $(xml);

            // push categories
            $xml.find('categories item').each(function(i, category) {
                options.xAxis.categories.push($(category).text());
            });

            // push series
            $xml.find('series').each(function(i, series) {
                var seriesOptions = {
                    name: $(series).find('name').text(),
                    data: []
                };

                // push data points
                $(series).find('data point').each(function(i, point) {
                    seriesOptions.data.push(
                        parseInt($(point).text())
                    );
                });

                // add it to the options
                options.series.push(seriesOptions);
            });
            var chart = new Highcharts.Chart(options);
        });


    });
    </script>

</head>
<body>

        <div id="container" style="width: 600px; height: 400px; margin: 0 auto"></div>


</body>
</html>

Where and how code ‘dataLabels’ to data of my 3 series is vertical?

dataLabels: {
                enabled: true,
                rotation: -90,
                color: '#FFFFFF',
                align: 'right',
                x: 4,
                y: 10,
                style: {
                    fontSize: '13px',
                    fontFamily: 'Verdana, sans-serif'
                }
            }

Merci.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:55:46+00:00Added an answer on June 17, 2026 at 11:55 pm

    You can set rotation to 90. demo

    Or you can set useHTML to true and style it using css.

    .highcharts-data-labels span {
        width: 7px;
        white-space: normal !Important;
    }
    

    Then your dataLabels formatter should be:

    formatter: function() {
        return this.y.toString().split('').join(' ');
    }
    

    This way you’ll get the labels the following way.

    9
    0
    0

    demo

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a graph using Highcharts plugin and the data should be
I want to create a graph of items on a certain day using data
I have an XML file and I want to create a graph based on
I want to create a Login through Facebook on a website using Graph API
I am using Achartengine to create graph in my app. I want that my
I want to create a separate function to get specific data from Facebook graph
I want to create a matrix representation for a graph algorithm using the least
I want to create events on behalf of the user using the Graph API.
I want to create a graph using JFreeChart and display it in a java
I want to create a stacked bar graph as in url below (source: jpowered.com

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.