This is a migrated thread and some comments may be shown as answers.

Data source with web service

0 Answers 122 Views
Charts
This is a migrated thread and some comments may be shown as answers.
André
Top achievements
Rank 1
André asked on 01 Mar 2012, 02:55 PM
Hi,
I have a problem in the chart with data source and web service. The chart isn´t creating. Can anybody help me?
Thanks.

Obs: I use the Framework 3.5.

The code:
$("#chart").kendoChart({
    theme: $(document).data("kendoSkin") || "Metro",
    dataSource: {
        transport: {
        type: "odata",
        read: {
            url: "JSON.asmx/GetDashboard", //I tried to put "http://localhost:17844/WEB3/JSON.asmx/GetDashboard" too, but don´t created the chart
            dataType: "json"
        }
}
    },
    title: {
        text: "Rentabilidade",
        font: "<B>"
    },
    legend: {
        visible: false
    },
    chartArea: {
        background: "#e6e6e6",
        margin: 0
    },
    seriesDefaults: {
        type: "bar",
        labels: {
            visible: true,
            position: "center",
            format: "{0:P2}"
        },
        color: "#3B894E"
    },
    series:
                [{
                    field: "VlValor",
                    name: "Rentabilidade (%)"
}],
    categoryAxis: {
        field: "DsFuncionario",
        labels: {
            rotation: 0,
            padding: { right: 60 }
        }
    },
    valueAxis: {
        labels: {
            visible: false
        }
    },
    tooltip: {
        visible: true,
        format: "{0:P2}",
        font: "<B>"
    }
});   


And the web service return a string: [{"DsFuncionario":"DIRECAO","VlValor":10135.33},{"DsFuncionario":"EDIR","VlValor":3201.59},{"DsFuncionario":"EMERSON ","VlValor":-76703.79},{"DsFuncionario":"FABIO","VlValor":3868.37},{"DsFuncionario":"SANDRO","VlValor":974631.58}]

No answers yet. Maybe you can help?

Tags
Charts
Asked by
André
Top achievements
Rank 1
Share this question
or