Home forums Using CanvasJS combining candlestick chart and line chart (moving average line)

This topic contains 32 replies, has 4 voices, and was last updated by  Vineet Deodhar 5 months, 2 weeks ago.

Viewing 15 posts - 16 through 30 (of 33 total)
  • Author
    Posts
  • #19196

    Suyash Singh
    Participant

    @nisha,

    For a dataset, you can have only one Simple Moving Average. Calculating SMA over again will give you the same set of SMA and plotting it will lead to overlapping of two SMA’s. Also, you can refer this wiki on SMA for more info.

    ___
    Suyash Singh
    Team CanvasJS

    #19236

    nisha
    Member

    Can’t we have two dataset and two moving average for each data? I need two lines for two different data but I dont know how to get data for that line?

    #19285

    Suyash Singh
    Participant

    @nisha,

    Please have a look at this jsfiddle.
    ___
    Suyash Singh
    Team CanvasJS

    #19289

    nisha
    Member

    Thank you so much.

    #19329

    nisha
    Member

    How can we display exact decimal in Moving Average Calculation. Currently it is showing either .50 or 1. How can I show exact calculation like 1.82 if my calculation is 1.82 in moving average label.

    Also, How can I set left hand side point starting 0, 0.2, 0.4,0.6,0.8,1.0,1.2 etc. Normally it comes automatically but is there way to set it by code.

    Please help

    #19330

    nisha
    Member

    How can we display exact decimal in Moving Average Calculation. Currently it is showing either .50 or 1. How can I show exact calculation like 1.82 if my calculation is 1.82 in moving average Tool Tip.

    Also, How can I set left hand side Label point starting 0, 0.2, 0.4,0.6,0.8,1.0,1.2 etc. Normally it comes automatically but is there way to set it by code.

    Please help

    #19331

    Suyash Singh
    Participant

    @nisha,

    Please take a look at yValueFormatString for formatting y-values in the toolTip. Also, kindly refer axisX.minimum for setting a minimum value and axisX.interval for customizing the interval at which the axis labels are shown.
    ___
    Suyash Singh
    Team CanvasJS

    #20185

    In this candlestick chart, How do I change the colours of candles (e.g. blue for up-candles, red for down candles).
    Thanks.

    #20188

    Indranil Deo
    Member

    @d_vineet,

    You can set the color, risingColor, and fallingColor to change the color in Candlestick Chart as per your requirement.

    ___________
    Indranil Deo,
    Team CanvasJS

    #20194

    I could set the risingColor now.

    1) Regarding fallingColor, the documentation says that “fallingColor property can only be used with waterfall chart.”.
    Is there any workaround for this?

    2) How do I set the border color for candles? I searched the docs, but could not find it. So request you for help.

    • This reply was modified 5 months, 3 weeks ago by  Vineet Deodhar. Reason: added details
    #20198

    Indranil Deo
    Member

    @d_vineet,

    1) Regarding fallingColor, the documentation says that “fallingColor property can only be used with waterfall chart.”.
    Is there any workaround for this?

    In case of Candlestick Chart, fallingColor can be used to override the default color of those dataPoints whose values are less than the previous dataPoint.

    2) How do I set the border color for candles? I searched the docs, but could not find it. So request you for help.

    In Candlestick Chart, you can use color to set the default color of the dataPoint and the border of the dataPoint as well.

    ___________
    Indranil Deo,
    Team CanvasJS

    #20200

    I have tried as you advised.
    Now Up-candle and down-candle colors are done.
    The only issue remaining is border color of candlestick.
    Pl. refer to this jsfiddle.

    Since I have specified color: “red”(to get down-candle color), down-candle as well as border color have now become red.
    Any suggestion on this (to get rid of border-color)?

    Thanks.

    #20204

    Indranil Deo
    Member

    @d_vineet,

    Assigning color to every dataPoints based on the risingColor or fallingColor will work fine in your case. Please take a look at the method changeBorderColor(chart) in this updated jsfiddle.

    ___________
    Indranil Deo,
    Team CanvasJS

    #20205

    QDOS.
    That’s what I required.
    Suggestion:- You may think of including this “changeBorderColor” function into the library of canvasjs so that others can also get benefited.

    I really appreciate your service support quality.
    You surpass my expectation levels.
    Pl. keep it up and wish you and your team all the best.

    Thanks.

    #20208

    Indranil Deo
    Member

    @d_vineet,

    Thanks for the appreciation. We will reconsider the behavior in future releases.

    ___________
    Indranil Deo,
    Team CanvasJS

Viewing 15 posts - 16 through 30 (of 33 total)

You must be logged in to reply to this topic.