1

I have a highCharts Pie Chart that when using the fiddle shows the tooltips on mouseOver for data points just fine, as well as the click events when I click on a LegendItem or the pop-out effect of pie slices, but when I plug my code into my site it doesn't work on any version of IE or google chrome. I don't know what the deal is. Here's the tooltips working, as well as the click events, but none of them work in my code.

http://jsfiddle.net/hAnCr/

$("document").ready(
function(){
$('#container').highcharts({
        chart:{
            type:'pie',
            height: 250,
            width: 350
              },
        colors:[
            '#5485BC', '#AA8C30', '#5C9384', '#981A37', '#FCB319',     '#86A033', '#614931', '#00526F', '#594266', '#cb6828', '#aaaaab', '#a89375'
            ],
        title:{text: null},
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                showInLegend: true,
                dataLabels: {
                    enabled: false,                        
                    formatter: function() {
                        return this.percentage.toFixed(2) + '%';
                    }
                },                                  
            }
        },
        legend: {
            enabled: true,
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle'
        },
        series: [{
            type: 'pie',
            dataLabels: {

                    },
            data: [
                ['Domestic Equity', 38.5],
                ['International Equity', 26.85],
                ['Other', 15.70],
                ['Cash and Equivalents', 10.48],
                ['Fixed Income', 8.48]
            ]
        }]
    });
});

A second question I had was if I could do a switch statement within the data, basically create a function that passes in 1 parameter and depending on the parameter value, change up my data[] values?

Thanks for your help, NickG

MisterNeutron
  • 3,359
  • 3
  • 17
  • 20
Nick G
  • 1,209
  • 8
  • 34
  • 58
  • Are you getting any javascript errors in the console we can see? That code works in the jsfiddle, so unless you don't have jQuery on your side, I can't help without more information. – Nicholaus Chipping Apr 24 '13 at 15:18
  • im not receiving any JS errors, I have local versions of JQuery that i'm using, they aren't the most up to date, I tried using the most up to date versions and referencing them and I get a bunch of errors and nothing works, there are my references; i removed the rest of the file path since it wasn't necessary – Nick G Apr 24 '13 at 15:26
  • 1
    The minimun supported version of jQuery for Highcharts is 1.3.2. I would suggest doing as they specify and just including the latest libs, like this: If you have errors after that, fix those - the latest libs is a good place to start. – Nicholaus Chipping Apr 24 '13 at 15:32
  • The reason I have that is because of my SSL and domain name, I can't use the outside sources. I saved those sources locally and put them in my host folder where the other referenced files sit, but when I reference them I receive the error: SCRIPT5007: Unable to get property 'msie' of undefined or null reference for a different file altogether which I never see before referencing the newest JQuery versions either locally or through google apis. Thanks for your help btw, just not sure my issue here – Nick G Apr 24 '13 at 15:37
  • I would use the most recent libraries possible, and a quick look for your error shows this: http://stackoverflow.com/questions/5787245/ie9-javascript-error-script5007-unable-to-get-value-of-the-property-ui-obje - That might provide more useful information, as your JS should be just fine. – Nicholaus Chipping Apr 24 '13 at 16:50
  • This code doesn't work for IE (6,7,8) because you have extra comma in code (in jsFiddle click "jsHint" and find red dots in your code - hover them). Second, use only one jQuery, and make sure you have firstly loaded jQuery, then Highcharts. The last thing, as it is said before, use latest Highcharts version, please. – Paweł Fus Apr 25 '13 at 11:30

0 Answers0