Click here to Skip to main content
15,920,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to call highcharts(barcharts) in html pages.
how do i call.

here i am not getting barchart.when we give static number like 1,2,3 then chart is coming.
when we pass array values which r comming from controller dynamicaly then chart is not getting.

What I have tried:

tbuff = ["20","40","20"];
var series = [{
        name: 'PhaseVolatges&Currents',
        data: [50]
    }, {
        name: 'DC Bus Voltage',
        data: [tbuff[1]]
    }, {
        name: 'LoadCurrent',
        data: [tbuff[2]]
    }, {
        name: 'BatteryCurrent',
        data: [tbuff[3]]
    }, {
        name: 'DC RectifierO/PCurrent',
        data: [tbuff[4]]"
    }
];
Posted
Updated 21-Jul-16 20:48pm
v2

1 solution

Hi, I guess the problem is, you are passing string data rather than integer. Please try the following.

tbuff=["20","40","20"];

var series= [
    {
        name: 'PhaseVolatges&Currents',
        data: [50]
    }, {
        name: 'DC Bus Voltage',
        data: [parseInt(tbuff[1])]
    }, {
        name: 'LoadCurrent',
        data: [parseInt(tbuff[2])]
    }, {
        name: 'BatteryCurrent',
        data: [parseInt(tbuff[3])]
    }, {
        name: 'DC RectifierO/PCurrent',
        data: [parseInt(tbuff[4])]"
    }
]; 


Note: Convert the data input into Integer for showing the chat.

I hope this will help you. Please let me know if you are still facing the same issue after the changes.
 
Share this answer
 
Comments
Member 12363094 22-Jul-16 2:52am    
Hi thanks it is working fine

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900