Forum Replies Created by Sunil Urs

Viewing 15 posts - 526 through 540 (of 548 total)
  • in reply to: Question: How to toggle series using the legend #4611

    tim,

    This feature is planned for version 1.3 – which might take around a month.

    izv,

    Just wanted to inform you that the latest version contains a fix for this issue. Do update.

    in reply to: Event handling on Chart #4609

    Yes, you can do so. Because you don’t need event handler on any particular dataPoint/dataSeries but the entire Chart, you can directly use Chart’s Container element. Below is how

     

    <div id=”chartContainer” data-url=”https://canvasjs.com&#8221; style=”width: 600px; height: 300px;”></div>

     

    //Am using  jQuery here. You can do so even with plain javascript

    $(“#chartContainer”).click(function () {

    window.location.href = $(this).data(“url”);

    });

    in reply to: StockChart (Multiple chart panel) #4605

    Stock Charts are not supported by CanvasJS yet. But it is in our Road-map.

    in reply to: Using CanvasJS with bootstrap #4603

    CanvasJS requires the container’s height and width to be set in order to render. While BootStrap sets width of the container based on the class(span6, span10, etc) that you set, it doesn’t set the height. Hence the problem. Just set the height of the container (or Chart) and it should work fine.

    <div class=”span10″ id=”chartContainer” style=”height: 400px;”></div>

    in reply to: StockChart (Multiple chart panel) #4602

    Peymanmi,

    Did you mean to say Multi Series Charts? In that case can you have a look at Multi Series Chart section.

    If not, can you share a screenshot or something depicting the same?

    in reply to: Multi Series Line Graphs #4569

    The above code works for me except that the quotes had to be changed from “ to “.

    Here is the working code
    http://jsfiddle.net/canvasjs/HA2JY/

    Multi-Series Line Chart

    If this is not what you expected, can you please tell me the expected behavior?

    in reply to: Multi Series Line Graphs #4554

    Jim,

    In order to show two line charts, you need to add two separate dataSeries – one for each line. You can just modify the same dataPoints array. So the code would go something like this

    data: [
    	{
    		type: "line",
    		dataPoints : dps1
    	},
    	{
    		type: "line",//or column, area, etc
    		dataPoints : dps2
    	}
    ]

    Follow the link to learn more about Multi Series Charts & Combination Charts

    Multi Series Line Chart

    in reply to: Y data points do not graph #4547

    Thanks, have edited the same.

    in reply to: Y data points do not graph #4545

    james,

    I just looked into your json data and it seems like the json API is returning all numeric values as string. Just make sure you convert string values to number before assigning them to “y”

    This should work

    `dataPoints.push({ x: i, y: Number(parsed_json.history.observations[i].tempi)});`

    http://www.w3schools.com/jsref/jsref_number.asp

    izv,

    We were able to reproduce the issue. Will be fixing it at the earliest – in a day or two.

    in reply to: Getting the Plot Area from CanvasJS #4313

    Jit,

    We have not exposed the function getPlotArea and that is the reason why you are not able to call it. As of now you can only use the APIs mentioned in our documentation. May I know why you need this method?…

    in reply to: Re-sizing the chart #4311

    By default Chart takes the size of its container (if set). So you can just set the width and height of the container in which you are going to place the chart as shown below – this is the suggested method.

    <div id="chartContainer" style="height: 300px; width: 500px;">

    Else you can also set the same using “width” and “height” property at the top level of options.

    var chart = new CanvasJS.Chart("chartContainer", {
    width:600,//in pixels
    height:800,//in pixels
    title: {
    text: " Chart Title ",
    }
    .....
    .....
    }

    Chart with Custom Width

    • This reply was modified 11 years, 6 months ago by Sunil Urs.
    in reply to: Rendering a Chart with a button click #4305

    Chart is not getting rendered because its getting submitted upon click. If you just want to render chart on click of a button, don’t use “form”. Use normal text field and render the chart upon button click.

    Here is your working code. Note that jsfiddle is set to execute the javascript upon onLoad event – so, you have to write onload explicitly on your local machine

    http://jsfiddle.net/jx9sJ/5/

    Render chart on button click

    in reply to: Rendering a Chart with a button click #4301

    thank you… we are glad that you like CanvasJS :)

    Can you please post the code that you have written so that we get some idea on what is going wrong… you can also use jsfiddle for the same.

Viewing 15 posts - 526 through 540 (of 548 total)