Home forums Using CanvasJS Need Average between primary and secondary axis

This topic contains 2 replies, has 2 voices, and was last updated by  mujahid_102 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #14656

    mujahid_102
    Member

    Dear

    I am using CanvasJS and I am very much happy about this. Now I need help to calculate average between primary and secondary y-axis on Bar Chart. Suppose I am comparing values between two marks. Two teachers given their marks on a single question. I want to compare both and generate the average and show it either level or index level. I can access only one value using
    indexLabelFormatter: function (e){
    e.dataPoint.y
    }

    but cant access both primary and secondary values at a time. I need help please. A sample shown in bellow
    |
    |_____________
    Q2 |____________|_3___________
    (avg 4) |_________________________|5
    |_________________________
    Q1 |_________________________| 5
    (avg 4.5)|___________________|4
    |_____________________________________

    #14661

    Suyash Singh
    Moderator

    @mujahid_102,

    Thank you for your interest in CanvasJS.

    Here is an example of showing the average on axis labels. For this you need to find the average of dataPoints and set it to axis label using chart options before rendering the chart.


    Suyash Singh
    Team CanvasJS

    #14666

    mujahid_102
    Member

    Thanks a lot brother

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

You must be logged in to reply to this topic.