Forum Replies Created by Vishwas R

Viewing 15 posts - 1,246 through 1,260 (of 1,601 total)
  • in reply to: Uncaught SyntaxError: Unexpected token import #17342

    [UPDATE]

    We have released React Component for Charts using which you can build charts in react way. Please refer to this blog post for release note.


    @netcon
    ,

    Adding type=”text/babel” to the src attribute of script tag should work fine. Please refer this stackoverflow thread for more information.

    If you are still facing issue, kindly create sample project reproducing the issue you are facing and share with us over Google-Drive or Onedrive so that we can run it locally to understand the scenario better and help you out.

    Also please take a look at this JSFiddle for an example on rendering Column Chart using ReactJS.
    Column Chart in React


    Vishwas R
    Team CanvasJS

    • This reply was modified 3 years, 8 months ago by Vishwas R.
    in reply to: Custom CSS on Index Label #17334

    Praveen,

    We don’t have plugin architecture within the product as of now. However you can add custom DOM elements on top of chart and customize it the way you want. Please take a look at this jsfiddle. Also refer Position Image over Chart for tutorial on positioning DOM on chart.


    Vishwas R
    Team CanvasJS

    in reply to: Dynamic Charts using Database #17329

    @tdono,

    You can render chart with data from html-table by reading entire column and by parsing it to the format accepted by CanvasJS.

    Please take a look at this jsfiddle.


    Vishwas R
    Team CanvasJS

    in reply to: Custom CSS on Index Label #17311

    @praveen-garg,

    Applying custom CSS to indexLabel is not available as of now, but you can customize toolTip either by using contentFormatter or by over-riding toolTip class as shown in this jsfiddle.

    In bar/column charts, indexLabels are placed inside or outside based on the available space. You can set indexLabelPlacement in dataSeries level to outside so that indexLabels are shown outside the bar.


    Vishwas R
    Team CanvasJS

    in reply to: Dynamically build a linear chart from JSON with date? #17310

    @dimas19801,

    Please refer Tutorial on Creating Charts from JSON Data & AJAX.

    The JSON data needs to parsed before passing it to chart-options. Check out the below code snippet for the same.

    $.getJSON("https://api.npoint.io/6be170cb804361d314e3", function(chartData) {  
    	for(var i = 0; i < chartData.length; i++){
      	dps.push({ x: new Date(chartData[i].x), y: chartData[i].y});
      }
    	chart = new CanvasJS.Chart("wtChart", {    
      	title: {
        	text: "Chart from External JSON Data"
        },
        data: [
          {
            type: "column",
            dataPoints: dps
          }
        ]
      });
      chart.render();
    });

    Please check this JSFiddle for complete code.

    Chart from external JSON with datetime values on X Axis


    Vishwas R
    Team CanvasJS

    in reply to: Hyperlink in Tooltip doesn't work #17257

    @vidsocio,

    Sorry for the inconvenience. We are looking into the issue. Meanwhile you can over-ride CSS as shown in this jsfiddle.


    Vishwas R
    Team CanvasJS

    Tom,

    A logarithmic axis can only plot positive values. There is no way to put negative values or zero on a logarithmic axis.

    Fundamental: If 10L = Z, then L is the logarithm (base 10) of Z. If L is zero, then Z equals 1.0. If L is a less than 0, then Z is a positive fraction less than 1.0. If L is greater than 0, then Z is greater than 1.0. Note that there no value of L that results in a value of Z that is zero or negative. Logarithms are simply not defined for zero or negative numbers.


    Vishwas R
    Team CanvasJS

    in reply to: How to display chart as a static image (png, jpg) #16009

    @davidr,

    JavaScript does not have access to the computer’s file system, please refer this stackoverflow thread for more information on the same. Either you can render chart as-such without interactivity or store base64 image globally and replace chart with image with stored base64 image data as source to show static image in a webpage.


    Vishwas R
    Team CanvasJS

    in reply to: How to display chart as a static image (png, jpg) #15997

    @davidr.

    You can get base64 image data of a canvas by using toDataURL. As CanvasJS charts are rendered on canvas, you can use toDataURL on chart to get base64 image data of the chart. Passing base64 data as source of image should work fine in your case. Please find the code-snippet below

    var base64Image = chart.canvas.toDataURL();
    document.getElementById('chartContainer').style.display = 'none';
    document.getElementById('chartImage').src = base64Image;

    Please check this JSFiddle for an example on the same.

    exporting chart as base64 image


    Vishwas R
    Team CanvasJS

    in reply to: Synchronize Tooltip Location #15946

    @rcardenas,

    Please take a look at this jsfiddle.


    Vishwas R
    Team CanvasJS

    in reply to: Can canvasjs work with webpack #15774

    Austin,

    Glad it’s working. Thanks for letting us know.


    Vishwas R
    Team CanvasJS

    in reply to: A variable for dataPoints #15771

    @rietveld,

    Datapoint y-value should be number, but in your case its string. Converting string values to number before assigning them to “y” should work fine in your case. dps.push({label: item.Name, y: Number(item.Total) });


    Vishwas R
    Team CanvasJS

    in reply to: Can canvasjs work with webpack #15618

    @austin,

    We have fixed the issue and here is an internal build for the same. Kindly download the fixed version and let us know your feedback.
    Colun Chart with Webpack


    Vishwas R
    Team CanvasJS

    in reply to: Min-Max Y-Axis Points Not Showing #15494

    @oneworld,

    Integral multiple of interval means if interval is 10, ticks will be shown at every values that are multiples of 10 like -30,-20,-10,0,10,20,30 etc irrespective of the minimum and maximum set. If minimum/maximum set is integral multiple of the interval, tick will be shown at minimum/maximum as-well, else it won’t be shown.


    Vishwas R
    Team CanvasJS

    in reply to: Min-Max Y-Axis Points Not Showing #15478

    @oneworld,

    To show tick/value at minimum and maximum, minimum and maximum should be integral multiples of interval. i.e. tick/value will appear only at y-values that are integral multiples of the interval.


    Vishwas R
    Team CanvasJS

Viewing 15 posts - 1,246 through 1,260 (of 1,601 total)