Forum Replies Created by Vishwas R

Viewing 15 posts - 121 through 135 (of 1,625 total)
  • in reply to: Draw a line over canvas chart #39148

    @eshan_23,

    As addressed by @adithya-menon in the original thread, you can either use area or range-area charts to create polygon shapes. Please refer to this JSFiddle for an example on drawing hexagon using area chart.


    Vishwas R
    Team CanvasJS

    in reply to: Custom width for some columns in column chart #39053

    @inferno,

    It’s not possible to have different width for each column as of now.


    Vishwas R
    Team CanvasJS

    in reply to: indexLabel with the name of month not in english #38985

    Andrea,

    You can show month names in Italian by passing month names in culture. Below is the code-snippet showing the same.

    CanvasJS.addCultureInfo("it", {                  
      months: ["gennaio", "febbraio", "marzo", "aprile", "maggio", "giugno", "luglio", "agosto", "settembre", "ottobre", "novembre", "dicembre"]      
    });
    var chart = new CanvasJS.Chart("chartContainer", {
      culture: "it",
      .
      .
      .
    }

    Please take a look at this JSFiddle for an example.
    Chart Localization - Showing Months in Italian


    Vishwas R
    Team CanvasJS

    in reply to: Gap between datapoints #38980

    @lars_,

    CanvasJS Chart just renders the data that you pass in chart-options. And in case of line charts, it draws a continuous line to connect all the non-null datapoints present in a dataseries. A gap / discontinuity in the line can be observed only when there is a null datapoint with the dataseries. You can set connectNullData to true to make it continuous by connecting line between non-null data.

    If this doesn’t solve in your scenario, kindly reproduce the scenario either in JSFiddle with dummy data & share it with us (or a sample project & share over Google-Drive/Onedrive) so that we can run it locally to debug & understand it better and help you out.


    Vishwas R
    Team CanvasJS

    in reply to: How to disable toolbar with zoom and reset button? #38979

    @reactdeveloper,

    Zoom / Pan & Reset buttons will be shown when you enable zooming in the chart. If you like to enable zooming, show the buttons but disable them, you can set HTML button’s disabled property to true. Please find the code-snippet below.

    var buttons = document.getElementsByClassName("canvasjs-chart-toolbar")[0].children;
    for(var i = 0; i < buttons.length; i++) {
      buttons[i].disabled = true
    }

    However, if you like to enable zooming but hide the buttons, you can set display: none !important; to canvasjs-chart-toolbar class. Please take a look at this JSFiddle for an example.


    Vishwas R
    Team CanvasJS

    in reply to: Rescale Y axis based on visible dataseries #38962

    @an01,

    Y-axis scaling seems to work fine, i.e. Y-axis range (minimum & maximum) gets adjusted as per the y-values present in the viewport.

    Can you kindly create JSFiddle reproducing the issue you are facing & share it with us so that we can look into the chart-options being used, understand the scenario better and help you out?


    Vishwas R
    Team CanvasJS

    in reply to: How to view in php page #38955

    @nilo,

    Please take a look at this gallery page for an example on rendering PHP chart with data from database. You can use multi-series chart in your case. Please take a look at this sample project for an example on rendering multi-series chart with data from database.
    PHP Chart with Data from Database


    Vishwas R
    Team CanvasJS

    in reply to: Multiseries Line Chart Mixture on Draw #38870

    @maestrofc27,

    I would suggest you to generate datapoints in the back-end and keep all other chart-options in the front-end itself. Please take a look at this gallery page for an example on rendering chart with data from database.

    If you are unable to achieve it or if you encounter any issue while achieving the same, kindly create sample project with sample data & share it with us over Google-Drive or Onedrive so that we can run it locally at our end to understand the scenario better and help you out.


    Vishwas R
    Team CanvasJS

    Pavel Hulmak,

    Extra labels +1 & -1 are shown as interval is set manually. Based on the interval & some other factors, axis range is calculated & hence the extra labels are added in this case. You can overcome this by either not setting interval when there are less datapoints or by manually setting axis range. Please take a look at this updated JSFiddle.

    JavaScript Bar Chart with Label


    Vishwas R
    Team CanvasJS

    in reply to: Multiseries Line Chart Mixture on Draw #38800

    @maestrofc27,

    Data in the chart seems to move back & froth as CanvasJS renders chart with the data in the order you pass in the options without sorting. Passing data in ascending order of x-values or sorting it based on x-values before rendering the chart seems to work fine in this case. Please find the code-snippet for sorting datapoints in ascending order of x-values below.

    for(var i = 0; i < chart.options.data.length; i++) {
    	chart.options.data[i].dataPoints.sort(compareDataPointXAscend);
    }
    
    function compareDataPointXAscend(dataPoint1, dataPoint2) {
    	return dataPoint1.x - dataPoint2.x;
    }

    Please take a look at this updated JSFiddle for complete code.
    JavaScript Multi Series Chart with Sorted Data


    Vishwas R
    Team CanvasJS

    in reply to: I can’t show two or more graphs in a single PHP page #38799

    @franckinou,

    It seems the sample provided by you is restricted and requires permission. Can you please make the sample public so that we can download it to run locally at our to understand the scenario better and help you out?
    Google Drive Access


    Vishwas R
    Team CanvasJS

    in reply to: invoice #38726

    @lacina-martin,

    Glad to know that the issue is solved.

    In general, invoice will be automatically shared over mail once you purchase any license. You can also download the same anytime from My Account page under ‘Orders’ tab. For more license / sales related queries please contact sales@canvasjs.com.


    Vishwas R
    Team CanvasJS

    in reply to: Axis rounding iusse #38698

    @festo,

    Sorry, controlling the first label on the axes & showing labels at every interval as per position of first label is not available, as of now. Minimum & maximum will set the axis range & not the position from where the axis labeling should start. However, you can disable axis labels & use striplines to achieve this. Below is the code-snippet that shows adding striplines with labels to y-axis.

    function addStripLines(chart) {
      for (var i = chart.axisY[0].minimum; i <= chart.axisY[0].maximum; i += chart.axisY[0].interval) {
        chart.options.axisY.stripLines.push({
          value: i, 
          label: i, 
          labelPlacement: "outside", 
          labelFontColor:"black", 
          labelBackgroundColor: "transparent",
          color: chart.axisY[0].gridColor 
        });
      }
      chart.render()
    }

    Please take a look at this updated JSFiddle for complete code.

    Using Stripline Labels as Y-Axis Labels


    Vishwas R
    Team CanvasJS

    in reply to: Need charts having ranges instead of number #38535

    @fg,

    Bar / Column chart accepts 1 y-value & starts rendering bar from the baseline (zero). To pass y-values as a range, you can use range bar / range column chart. Kindly check out our gallery for live examples along with source-code.


    Vishwas R
    Team CanvasJS

    in reply to: Need charts having ranges instead of number #38398

    @fg,

    You can use Range Charts like Range Column Chart, Range Area Chart, etc. in this scenario. Please check out gallery for more examples along with source code.
    JavaScript Range Column Chart


    Vishwas R
    Team CanvasJS

Viewing 15 posts - 121 through 135 (of 1,625 total)