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

[Solved] Binding to local data

3 Answers 176 Views
Chart for HTML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Samuel
Top achievements
Rank 1
Samuel asked on 14 Mar 2013, 09:55 PM
Hi,

I'd like to create a RadChart with data from a local json file. Can you give me a simple example please?

Thanks
sam

3 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 15 Mar 2013, 11:34 AM
Hi Sam,

I prepared a small sample demonstrating how RadChart can be bound to data from a local JSON file. What is important here is to correctly set the dataSource of the chart:
dataSource: {
    transport:
    {
        read: {
            //url should point to the local file
            url: "/js/BooksJSON.json",
            //specify what type of data is expected
            dataType: "json"
        }
    },
    schema: {
        // specify the the schema is JSON
        type: "json",
        // the JSON object which represents a single data record
        data: "books.book"
    }
}

You can find the runnable sample attached to this message. Give it a try and let us know if you need further assistance with this.

Greetings,
Tsvetina
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Samuel
Top achievements
Rank 1
answered on 20 Mar 2013, 05:08 PM
Hi Tsvetina

thank you very much for your answer! Your sample works fine. I was able to adapt it to my dataset. Unfortunately it takes very long to produce the charts... (this is also the reason, why I thought, that my attempt doesn't work...). Do you think, there is a problem with huge dataseries? Or is there rather an errror in my structure?

I don't want to publish my data online, but I can send you my sample per mail. Please let me know, where to send it.

Best regards
sam
0
Tsvetina
Telerik team
answered on 21 Mar 2013, 07:50 AM
Hi Sam,

If the dataset is large, there would be a slow down in charts loading time but it is indeed better if we look at your implementation for any other problems.

You can submit a ticket through our ticketing system and send us the sample as attachment there. To do so, go to your Telerik account, in the main page click "Contact Support Team" and on the next page - "Submit Support Ticket". To be able to attach your project, first compress it to a .zip/.rar archive.

All the best,
Tsvetina
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
Chart for HTML
Asked by
Samuel
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Samuel
Top achievements
Rank 1
Share this question
or