Forum Replies Created by Ananya

Viewing 15 posts - 16 through 30 (of 44 total)
  • in reply to: Drawing horizontal lines #59900

    @rbadis,

    chart.addTo() method is used to add the line dataseries programmatically, as shown in the example. The code you are trying does not work because the series needs to be created before “type” or “datapoints” can be assigned.

    If you are looking to change the y-values such that the line is centered vertically, you can use the y-axis range to calculate the midpoint. In case you are still having issues, please create a JSFiddle and share with us, so that we can understand your scenario better and help you out.


    Ananya Deka
    Team CanvasJS

    in reply to: Making dashed legend marker #59893

    @kkoroleva,

    Setting legendMarkerType as ‘triangle’, and legendMarkerColor as ‘white’ seems to be working fine, and creates a dashed line legend marker. You can take a look this JSFiddle for the complete example.

    Chart with dashed legend marker

    If you are still facing any issue, please share a JSFiddle reproducing your use case, so that we can look into it and help you out.


    Ananya Deka
    Team CanvasJS

    • This reply was modified 7 months ago by Vishwas R.
    • This reply was modified 7 months ago by Ananya.
    in reply to: Drawing horizontal lines #59875

    @rbadis,

    Striplines are drawn either from top to bottom, or from left to right extremes. However, you can use a line chart to achieve your requirement. Please take a look at this JSFiddle for an example of the same.

    Chart with stripline and connecting line


    Ananya Deka
    Team CanvasJS

    in reply to: Last 24 hours on X axis from mysql #45867

    @amon75,

    Please refer to this Stack Overflow thread for more information on fetching last 24 hours’ data from database. You can pass the fetched data to the chart and render it.


    Ananya Deka
    Team CanvasJS

    in reply to: Last 24 hours on X axis from mysql #45838

    @amon75,

    Please take a look at this gallery page for an example on rendering chart with data fetched from MySQL database. you can also refer to this page for an article about the same.


    Ananya Deka
    Team CanvasJS

    in reply to: Update #45800

    @netbal21,

    You can get a reference to the chart instance and use it to update the data. Please take a look at this StackBlitz for an example of the same. You can also take a look at this gallery page for more examples of dynamic charts.


    Ananya Deka
    Team CanvasJS

    in reply to: why are some columns smaller than others? #45765

    @scompliance,

    Since the two charts have varying number of dataseries, there is a difference in datapoint width. You can use dataPointWidth property to enforce the same column width across the charts.


    Ananya Deka
    Team CanvasJS

    in reply to: why are some columns smaller than others? #45745

    @scompliance,

    Datapoint width depends on multiple factors including range of x-axis, number of dataseries, sequence of datapoint values, etc. Sorting the data by x-values should work in your case, and give you columns of similar width. Please take a look at this updated JSFiddle for an example of the same.

    column charts - datapoint width


    Ananya Deka
    Team CanvasJS

    in reply to: background on plot area #45702

    @scompliance,

    Setting the stripline that is used to set the background color to be the first in the stripLines array should work fine in this case. Please take a look at this updated JSFiddle for an example of the same.


    Ananya Deka
    Team CanvasJS

    in reply to: background on plot area #45685

    @scompliance,

    Thanks for your feedback. We will add it to our wishlist. In the meantime, you can use stripline to apply background color to the plotarea as a workaround. Please refer to this JSFiddle for an example of the same.


    Ananya Deka,
    Team CanvasJS

    @sujeet,

    You are getting this warning because angular-charts package uses CommonJS/AMD modules. You can suppress the warning by adding it to allowedCommonJsDependencies under build options in your angular.json file, as shown below:

    "build": {
        "options": {
            "allowedCommonJsDependencies": [
                "@canvasjs/angular-charts"
            ],
            ...
        },
        ...
    }

    Please refer to this angular documentation for more information.


    Ananya Deka
    Team CanvasJS

    in reply to: zoom toolbar is too low if no graph title is provided #45393

    @scompliance,

    Sorry, it’s not possible to move the toolbar using any property as of now. However, you can use CSS to style it, as it is a DOM element, and change its position. Please take a look at this CSS snippet for an example on how to do the same.

    .canvasjs-chart-toolbar {
        top: -50px !important;
    }


    Ananya Deka,
    Team CanvasJS

    in reply to: formatting time x-axis #45186

    @ben-haestqed-lu,

    valueFormatString seems to be working fine with date and time components. Can you kindly create a JSFiddle reproducing the issue you are facing and share it with us, so that we can look into the code and chart-options being used, understand the scenario better and help you out?


    Ananya Deka,
    Team CanvasJS

    in reply to: Convert coordinates to pixels, and vice-versa #45090

    @phrogz,

    Glad that you figured it out, and that works for you.


    Ananya Deka
    Team CanvasJS

    in reply to: Problem multi charts #45069

    @patdepri_new,

    You are attempting to create a chart in the div with id “chartContainer1” which does not exist. So the code stops executing and does not render anything on screen. Please check browser console for the error. Not creating chart with the id that doesn’t exist should render all other charts in this case.


    Ananya Deka
    Team CanvasJS

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