Forum Replies Created by Manoj Mohan

Viewing 15 posts - 256 through 270 (of 823 total)
  • in reply to: Typescript converts CanvaJS.Chart to undefined when building #35698

    @tjcrowder,

    Sorry, there is no official TypeScript type definition for CanvasJS as of now. However, this feature is there in our roadmap but no definite timeline yet as we are working on some other important features at this point in time.

    You really shouldn’t include node_modules in zips like that.

    Thanks for the suggestion. We have provided node_modules for the ease of the user to run the sample.

    —-
    Manoj Mohan
    Team CanvasJS

    in reply to: Chart within ToolTip or Chart within a Chart #35670

    @aisolutions,

    To display a chart inside tooltip, you can create a DOM required for the chart within tooltip using contentFormatter and render the chart on updated event of toolTip. Please take a look at this below code snippet for the same.

    toolTip: {
          updated: function(e) {
            typeof pieChart.destroy === "function" && pieChart.destroy();  
            pieChart = new CanvasJS.Chart('pie-chart', chartOptions[e.entries[0].dataPoint.label]);
            pieChart.render(); 
          },
          contentFormatter: function() {
            return "<div id='pie-chart' style='width:200px; height:200px;'></div>";
          },
    }

    Also, check out this JSFiddle for complete sample code for rendering the chart within tooltip.

    Displaying chart within Tooltip

    —-
    Manoj Mohan
    Team CanvasJS

    in reply to: How can I use PHP MySQL Dynamic data #35652

    @m-usman,

    Yes, you can use datetime in x-axis. In order to use datetime in x-axis, you need to first convert PHP date to timestamp using strtotime and then convert PHP timestamp to JavaScript timestamp by multiplying it with 1000.

    $phpDate = date("Y-m-d h:i:sa");
    $phpTimestamp = strtotime($phpDate);
    $javaScriptTimestamp = $phpTimestamp * 1000;

    You can refer to this thread for more information on using datetime on x-axis in PHP. Also, you can check out this gallery page for an example on using JavaScript timestamp in x-axis in PHP.

    —-
    Manoj Mohan
    Team CanvasJS

    in reply to: Remove CanvasJs link #35595

    @anton001,

    One of our sales representative will get in touch with you over email. For any license related query, please contact sales@canvasjs.com.

    —-
    Manoj Mohan
    Team CanvasJS

    @ketanajudiya,

    The use case you mentioned of indexLabel not being shown when y value is 0 was a bug and it has been fixed in the releases prior to 3.0. In order to hide indexlabel when y value is 0, you need to use indexLabelFormatter property.

    So, can anyone please suggest global fix for it, to hide 0 0 0 0 from all charts of my website?

    Sorry, as of now you cannot revert this behaviour globally. However, you can create a global function which takes chart object as parameter and set the indexLabelFormatter in the chart options and render it as shown in this code snippet.

    addIndexLabelFormatterToChart(chart);
    
    function hideIndexLabelOnZero(e) {
    return e.dataPoint.y !== 0 ? e.dataPoint.label + " " + e.dataPoint.y + " " + "kg": "" ;
    }
    
    function addIndexLabelFormatterToChart(chart) {
    chart.data[0].set("indexLabelFormatter", hideIndexLabelOnZero);
    
    }

    Also, check out this JSFiddle for complete working code.

    Hiding indexLabel when y value is 0

    —-
    Manoj Mohan
    Team CanvasJS

    in reply to: Legend Highlight #35062

    Neha,

    We don’t support setting fontColor, fontSize and fontWeight for each individual legend items as of now.

    —-
    Manoj Mohan
    Team CanvasJS

    in reply to: Legend Highlight #35054

    Neha Mahanjan,

    Highlighting legend on hover over chart series is not available as an inbuilt as of now. However you can achieve this functionality by updating legendMarkerColor within mousemove & mouseout events of dataseries as shown in this below codesnippet

    for(var i=0; i<chart.options.data.length; i++) {
        chart.options.data[i].mouseover =  highlightLegend;
        chart.options.data[i].mouseout =  dimLegend;
      } 
    
      chart.render();
    
      function highlightLegend(e) {
        for(var i=0; i<e.chart.options.data.length; i++) {
          if(i !== e.dataSeriesIndex)
            e.chart.options.data[i].legendMarkerColor = "grey";  
        } 
    
        e.chart.render();
      }
      function dimLegend(e) {
        for(var i=0; i<e.chart.options.data.length; i++) {
          e.chart.options.data[i].legendMarkerColor = undefined;
        }
        e.chart.render();
      }

    Also, check out this JSFiddle for complete working code.

    Highlight legend marker color on hover over Dataseries


    Manoj Mohan
    Team CanvasJS

    @svc_quaeris,

    We are sorry for the inconvenience caused, we will address this issue in our future releases as currently we are working on some important features. However, if interactivity is not required in your use-case you can extract the image of chart, destroy the chart and use the image in place of chart. Please take a look at this JSFiddle for an example.

    —-
    Manoj Mohan
    Team CanvasJS

    in reply to: chart seems to work correctly in chrome only #34999

    @mlec,

    Chart seems to be working fine across different browsers like Chrome, Safari, Edge, Firefox, etc.

    In order to reproduce the issue at our end, can you kindly create a sample project and share it with us over Google-Drive or OneDrive along with sample data so that we can run it locally, understand the scenario better and help you out?

    —-
    Manoj Mohan
    Team CanvasJS

    in reply to: Fix number of graduations #34907

    @simhoude,

    You can set the interval of the axis based on your dataset to fix number of graduations of axis. Please check out this documentation page for more information on setting interval of axisX.

    chart with x axis interval

    —-
    Manoj Mohan
    Team CanvasJS

    in reply to: Stripline Label on right side #34858

    Wolfgang,

    It is not possible to show/position stripline label on the right side of the line as of now. However, you can place stripline label to near, far and center from axis line using labelAlign property.

    labelAlign property in Striplines

    —-
    Manoj Mohan
    Team CanvasJS

    in reply to: Trendline for scatter chart #34842

    @dunhamcd,

    As of now, CanvasJS doesn’t have the option to add equations / technical indicators as an inbuilt feature. However, you can generate datapoints as per the equation & add a spline dataseries to the chart with few lines of code. Please take a look at this JSFiddle for an example on the same.

    Chart with datapoints from the equation

    Also, you can check out this forum thread for more info on adding technical indicators (SMA & EMA).

    —-
    Manoj Mohan
    Team CanvasJS

    in reply to: Doughnut Chart Show Icons in Subtitle #34827

    @kpandey017,

    You can use unicode characters to show icons in subtitles. Please check out this JSFiddle for an example on adding unicode characters in subtitles. Also, refer to this Wikipedia page for list of unicode characters.

    Icon in subtitles of Chart

    —-
    Manoj Mohan
    Team CanvasJS

    in reply to: React Hooks #34797

    @manny,

    Please take a look at documentation page for step by step tutorial on using CanvasJS React component.

    If this doesn’t fulfill your requirements or still facing issue, can you kindly brief us further along with an example so that we can understand your scenario better and help you out?

    React Chart & Graphs

    —-
    Manoj Mohan
    Team CanvasJS

    in reply to: Day Planner #34765

    @rahul-instrongmail-com,

    You can use range-bar chart to plot for day planner. Please take a look at this JSFiddle for an example on the same.

    Day Planner using Range Bar Chart

    —-
    Manoj Mohan
    Team CanvasJS

Viewing 15 posts - 256 through 270 (of 823 total)