Home forums Using CanvasJS How to get data of selected slices in pie chart

This topic contains 1 reply, has 2 voices, and was last updated by  Indranil Deo 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #24415

    I am making pie chart by following this link

    Pie Chart

    I have two questions:

    1. I want to get the data of selected slices , please give me the code for it.
    2. I want to set some selected pie slices by default on page load,

    Actually I have two pages in which I want to implement pie chart.
    In first page user select some sections of pie chart and then he click on button on that page, which will redirect user to another page, in which we create same pie chart by showing some selected pie slices expanded by default on the basis of slices selected by user in first page.

    Please advise me how to do it.

    Thanks
    Sachin

    #24426

    @vipsachinverma,

    1. I want to get the data of selected slices , please give me the code for it.

    You can use the click event handler to get the data of the selected dataPoints on a chart.

    2. I want to set some selected pie slices by default on page load,

    You can achieve the above requirement by setting the exploded property to true for the dataPoints you would like to highlight.

    ___________
    Indranil Deo,
    Team CanvasJS

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.