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

[Solved] Scroll in a column chart

2 Answers 106 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.
Juan Maria
Top achievements
Rank 1
Juan Maria asked on 24 Jul 2012, 09:04 AM
I am using an evaluation version of RadControls for Metro/HTML and I am trying to create a chart that allow the user to scroll it with the finger, but I cannot figure out how to achive this.

Could anyone give a suggestion?.

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Veli
Telerik team
answered on 24 Jul 2012, 01:18 PM
Hi Juan,

RadChart for Metro / HTML itself does not support scrolling, but you can initialize your chart in a wider container that its parent element. Thus, the parent element will be scrollable:

<!--RadChart is initialized in a container that is 1000px wide, while the
parent container is only 600px. Setting overflow:auto; will enable scrolling-->
<div style="width:600px; overflow:auto; padding-bottom: 20px">
    <div id="chart" style="width:1000px" data-win-control="Telerik.UI.RadChart" data-win-options="{
        dataSource: {
            transport: {
                read: {
                    url: '/data/spain-electricity.json',
                    dataType: 'json'
                }
            }
        },
        series: [
            { type: 'column', field: 'solar' },
            { type: 'column', field: 'hydro' },
            { type: 'column', field: 'wind' },
            { type: 'column', field: 'nuclear' }
        ],
        categoryAxis: {
            field: 'year'
        }
        }"></div>
</div>


Greetings,
Veli
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Juan Maria
Top achievements
Rank 1
answered on 26 Jul 2012, 10:10 AM
Thanks, it worked!
Tags
Chart for HTML
Asked by
Juan Maria
Top achievements
Rank 1
Answers by
Veli
Telerik team
Juan Maria
Top achievements
Rank 1
Share this question
or