Forum Replies Created by Vishwas R

Viewing 15 posts - 1 through 15 (of 1,612 total)
  • in reply to: Range selector issue #60531

    @genn7,

    You are encountering this issue because you’re modifying the axis minimum and maximum values within the rangeChanged event handler. Instead, performing all the necessary calculations within the rangeChanging event handler or calling stockChart.render() after completing the calculations in rangeChanged should resolve the problem. Please take a look at this updated JSFiddle for a working example.


    Vishwas R
    Team CanvasJS

    in reply to: PlotBands #60530

    James,

    CanvasJS does support a feature similar to plotBands in Highcharts called stripLines. You can use stripLines in two ways:

    1. Single threshold (value): You can set a value for the stripLine to highlight a single threshold on the axis.
    2. Range (startValue and endValue): You can define both startValue and endValue to highlight a specific region, effectively creating a plotBand-like effect to emphasize a section of the chart between two axis values.

    Please find the code-snippet for creating a stripLine (plotband) below:

    axisY:{
      stripLines:[{                
        startValue: 25,
        endValue: 32,                
        color: "#d8d8d8"                
      }]
    }

    stripLine on axisY


    Vishwas R
    Team CanvasJS

    in reply to: showing license expired #60503

    @sigma,

    With your perpetual license, you can use CanvasJS for as long as you like without any additional payments. The “expired” message you’re seeing refers to the subscription for updates, which is free for the first year. During the first free update period, you can download the latest versions available. After this period, you can still download older versions, but you will no longer have access to new updates unless you renew your updates subscription.

    For any sales-related queries, feel free to contact sales@canvasjs.com.


    Vishwas R
    Team CanvasJS

    in reply to: canvasJs not working in new version Nextjs #60469

    @mahi_mso,

    CanvasJS React Charts seems to be working fine with the latest version of Next.js (v15.1.6) & React (v19.0.0GA). Please refer to this article for a tutorial on adding CanvasJS Chart in Next.js app.

    Can you kindly try updating all the packages to latest & check if that works? If the issue still persists, kindly create a sample project reproducing the issue, upload it to Google-Drive or Onedrive & share the link with us so that we can run it locally at our end, understand the scenario better and help you out?


    Vishwas R
    Team CanvasJS

    in reply to: Installing from NPM #60438

    Peter,

    You can download the commercial version package from the My Account page and the steps to integrate have been addressed in the instruction.html file which is present inside each package under the @canvasjs folder. For example, if you are integrating CanvasJS charts with Angular, download the commercial version and navigate to @canvasjs > angular-charts > instruction.html

    Additionally, you can even host the commercial version of the CanvasJS chart package (@canvasjs/charts) on your own server by following these steps:

    1. Compress the package into a .tar.gz file.
    2. Upload the compressed file to your server.
    3. In your package.json, reference the package using the URL of your server, like this:

    @canvasjs/charts": "https://your-domain.com/packages/canvasjs-charts-v3.11.0.tar.gz

    This approach avoids conflicts with public npm versions and integrates smoothly into your app. Please refer to this article for more information.


    Vishwas R
    Team CanvasJS

    in reply to: suddenly only get black screen when showing a chart #60437

    Gitte Kynde,

    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, understand the scenario better, and help you out?

    From what we have observed, sometimes things get delayed mostly when we are unable to reproduce the issue or not able to understand the exact requirements or the solution that we provide may not work properly due to the variation in chart-options being used by you and us.

    Having a JSFiddle helps us in figuring out the issue and many a time we can just edit your code on JSFiddle to fix the issue right away.


    Vishwas R
    Team CanvasJS

    in reply to: Reading CSV data #60340

    @northernboy70gmail-com,

    For security reasons, browsers restrict reading local CSV files and cross-origin requests. Serving CSV file from a local web server and making an AJAX call to it or serving it from CORS enabled CSV hosting should work fine in this case. Please refer to this StackOverflow post for more information.


    Vishwas R
    Team CanvasJS

    @scompliance,

    Zooming across charts is not working after switching the dashboard as you are resetting the chart-references on switching the charts. Instead setting the selectedDashboard only if the value has changed & adding chart-references only once should work fine for you. Please find the updated code-snippet below.

    Change selectedDashboard only if the value has changed.

    const handleDashboardChange = (event) => {
      if (event.target.value !== selectedDashboard) {
        setSelectedDashboard(event.target.value);
      }
    };

    Add chart-ref only once.

    <CanvasJSChart
      key={index}
      options={options}
      onRef={(ref) => {
        if (ref && !chartsRef.current.includes(ref)) {
          chartsRef.current.push(ref);
        }
      }}
    />

    Please take a look at this updated Stackblitz for working example.


    Vishwas R
    Team CanvasJS

    in reply to: Show lines as dotted in legend #60305

    @scompliance,

    Changing legend line dash type is not possible as of now. However, you can achieve rendering broken line in legend by setting the legendMarkerColor to white (same as chart background) and legendMarkerType to triangle. Please take a look at this JSFiddle for an example of the same.

    chart with dashed legend


    Vishwas R
    Team CanvasJS

    in reply to: chart.container is null in some cases #60275

    @scompliance,

    chart.container / chart.get(“container”) is accessible & seems to be working fine. Can you kindly share a JSFiddle (or Sample project over Google Drive / Onedrive) reproducing the issue so that we can run it at our end to understand the scenario better and help you out?


    Vishwas R
    Team CanvasJS

    in reply to: By default the height of the chart is 400 in react #60170

    @scompliance,

    To ensure that the chart adjusts to the updated height, you can use a key prop on the CanvasJSChart component. When the height state changes, updating the key prop will force React to treat the component as a new one, which will apply the updated height. Please find the updated code-snippet below.

    return (
      <div>
        <CanvasJSChart
          options={options}
          containerProps={{ width: "100%", height }}
          key={height}  // This forces re-mount when the height changes
        />
      </div>
    );

    Another option is to directly update the chart’s height using the set methodchart.set("height", 100). Please refer to this Codesandbox link for updated code.


    Vishwas R
    Team CanvasJS

    in reply to: Pyramid Chart itemClick #60029

    @taoufiq,

    Thank you for reporting the issue and providing the use-case. We will investigate this further and work on a fix for future versions. Your feedback is greatly appreciated!


    Vishwas R
    Team CanvasJS

    in reply to: How can I remove the Hyphen associated with my axisY values? #59990

    @ayankhan21,

    Are you referring to the axis ticks? If so, you can remove the hyphen next to the axis labels by setting the tickLength to 0. This will hide the ticks completely. If you’re referring to something else, could you please share a pictorial representation so that we can understand the scenario better and help you out?

    Axis Ticks, Grids & Interlaced Colors


    Vishwas R
    Team CanvasJS

    in reply to: StockChart Price Displays #59984

    Adam Evans,

    Updating legendText on hovering over the datapoint should work fine as per your requirements. Please find the code-snippet below.

    mouseover: onMouseover(e){	
        e.dataSeries.legendText = (e.dataSeries.dataPoints[e.dataPointIndex].x + ": " + e.dataSeries.dataPoints[e.dataPointIndex].y).toString();
        e.chart.render();
    }

    Please take a look at this JSFiddle for an example of the same.


    Vishwas R
    Team CanvasJS

    @discovered1086,

    The chart is currently taking 100% of the container’s width and seems to be working fine. Could you please create a JSFiddle (or Stackblitz for React/Angular apps) that reproduces the issue & share it with us so that we can look into the code, understand the scenario better and help you out?


    Vishwas R
    Team CanvasJS

Viewing 15 posts - 1 through 15 (of 1,612 total)