Since the Container is not displayed initially, chart takes the default values for width and height.
To show the chart with given height and width of the container, just re-render the chart once the chart container is displayed. Here is a JSFiddle for same.
You can also take a look at following examples if you’re working on Bootstrap:
Example 1,
Example 2
Example 3
——
Bivek Singh
Team CanvasJS
It happens because bubbles require some space to represent itself and axisX actually starts from the value of first dataPoint and ends at value of last dataPoint. If you don’t want to clip the bubbles, you can change minimum and maximum values of axisX. This new changed value depends upon the size of first and last bubble size.
var min = chart.axisX[0].get("minimum");
var max = chart.axisX[0].get("maximum");
chart.axisX[0].set("minimum", min - 1);
chart.axisX[0].set("maximum", max + 1);
You can check with subtracting and adding different values instead of 1 to meet your requirement.
——
Bivek Singh
Hi @gregoff
Thank you for your feedback. If I understood your requirements correctly, you can do that with a few lines of code. Here is a jsFiddle for same.
In case you are looking for something else, could you please send us a pictorial representation of the requirements so that we can understand it properly and assist you accordingly.
——
Bivek Singh
You can create an additional canvas and place it top of our rendering canvas. Please take a look at this jsFiddle.
—-
Bivek Singh
Is it possible to use stripLines on pie/donut charts? I need to mark a specific point on a donut chart.
->It is not possible to use striplines on pie/doughnut chart as of now.
Is it possible to have data labels be different colors? I can’t seem to accomplish it, just the same color throughout multiple labels.
->You can use indexLabelFontColor property to set different font color to indexLabels.
Is it possible to have stripLine labels be positioned “inside” but also be oriented horizontally? I want it to be at the top, but to the side of the stripLine, but still horizontal.
->While you can place stripLine label inside and on top, it is not possible to display the label horizontally as of now.
—-
Bivek Singh
cshickman,
I’m sorry but this is not possible as of now.
As of now, it is not possible to draw 2 different charts in one container. For your second query, can you provide some pictorial representation so that we can understand your requirement in better way and help you out?
JavaScript uses milliseconds as a timestamp, whereas PHP uses Unix timestamp which is in seconds. So, you need to convert PHP timestamp to JS timestamp. You can multiply PHP timestamp by 1000 to get JS timestamp. For further information, you can refer this post on StackOverflow.
Sorry, padding between tick and axis Label is not possible as of now.
Are you looking for something like this?
karimmaurice,
There can be various reasons due to which the page scrolls to the chart. Are you rendering the chart on trigger of some event? Or does that happen even for the first chart render without any event associated to it? If you are rendering it on trigger of some event, prevent the default action of that event using event.preventDefault();. If this doesn’t solve your issue, please create a jsFiddle so that we can further look into the issue.
We tested with android phones including all the major browsers and it seems to be working fine. Can u please let us know which device/model you faced this issue along with browser details? Are you facing this issue on mobile phones as well? Please let us know, so that we can look into it further.
User control over padding to the chart is in our road-map but we don’t have a timeline yet.