Home Forums Chart Support How to disable datapoints ‘ x attribute which auto set in boxChart

How to disable datapoints ‘ x attribute which auto set in boxChart

Viewing 4 posts - 1 through 4 (of 4 total)
  • #30615

    I am trying to run BOXPLOT chart where we need to give data in the {label:””,y:””} format. But whenever I give this data, it automatically adds x attribute. Due to this, I cant plot the chart. any solution to disable auto x attribute or something. Thank you.

    data:
    {label: “CRIM”, y: Array(100)}
    {label: “ZN”, y: Array(100)}
    {label: “INDUS”, y: Array(100)}
    {label: “CHAS”, y: Array(100)}
    {label: “NOX”, y: Array(100)}
    {label: “RM”, y: Array(100)}

    data after i give to datapoints in options:
    {label: “CRIM”, x: 0, y: Array(100)}
    {label: “ZN”, x: 1, y: Array(100)}
    {label: “INDUS”, x: 2, y: Array(100)}
    {label: “CHAS”, x: 3, y: Array(100)}
    {label: “NOX”, x: 4, y: Array(100)}
    {label: “RM”, x: 5, y: Array(100)}

    #30626

    @nikunj295,

    When x-values are not provided in the dataPoints, internally it takes x-value as 0, 1, 2, … and increases based on the number of dataPoints. These x-values are used internally for calculating axis range, positioning dataPoints, etc.

    Can you kindly brief us more about your exact requirement so that we can help you out with an appropriate approach?


    Shashi Ranjan
    Team CanvasJS

    #30697

    It was my mistake actually, I thought that giving a whole array of values to the Y variable will automatically calculate median, mean, q1,q2, and q3 for boxplot. But we need to assign the value manually in y variable in this format [mean,q1,q3,q1, median] something like this and I actually sent the whole array of 100 values in the Y variable.

    • This reply was modified 3 years, 8 months ago by nikunj295.
    #30717

    @nikunj295,

    Glad you figured it out :)


    Shashi Ranjan
    Team CanvasJS

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

You must be logged in to reply to this topic.