You can set the viewportMinimum as viewportMinimum: new Date(2019,03,14)
and viewportMaximum as viewportMaximum:new Date(2019,04,14)
to achieve zooming programmatically over data/time axisX type.
——-
Manoj Mohan
Team CanvasJS
Removing the following line seems to be working fine require "getjson.php";
. If the issue still persists, kindly share sample project along with sample database over Google Drive or Onedrive so that we can run it locally at our end, understand the issue better and help you out.
——
Manoj Mohan
Team CanvasJS
You can programmatically zoom into a region by setting viewportMinimum and viewportMaximum.
To zoom into a certain region, there should be a minimum of 3-4 dataPoints – behavior is designed such that zooming is limited upto a certain region, so the user doesn’t end up zooming into a blank-region (region with no dataPoints). Due to this restriction, it’s not possible to pan chart as you zoom into the region with just 1 dataPoint.
——-
Manoj Mohan
Team CanvasJS
You can keep just one JSON file. Parsing JSON data before passing it to chart options should work fine in this case. Please take a look at this JSFiddle.
——-
Manoj Mohan
Team CanvasJS
You can use multiseries chart to fulfill your requirements. Please take a look at this JSFiddle.
—–
Manoj Mohan
Team CanvasJS
You can open bootstrap modal and pass the link attribute of respective datapoint clicked to modal by using click event handler of dataPoints as shown in below code snippet.
var link;
function onClick(e){
link = e.dataPoint.link;
$('#myModal').modal('show');
};
$('#myModal').on('shown.bs.modal', function (e) {
$('#myModal').find('.modal-body').load(link)
});
$('#myModal').on('hidden.bs.modal', function (e) {
$('#myModal').find('.modal-body').html('')
});
Please take a look at this JSFiddle for complete working code.
——
Manoj Mohan
Team CanvasJS
hi, i want to make fix chart of x and y value are not change base on data point .
x axis value 40-180 interval 10 and
y axis value 145 to 200 interval 5
data point is low or high but this x y value not change.
You can achieve the above requirement using the splineArea chart and by setting the maximum and minimum for the axisX and maximum and minimum for the axisY based on your requirement.
2. i have to give fix background-image in graph create area which i want to show on pdf also .
i set background image it show on web but on save pdf time it will not show so i need to solve this issue ,thanks for help
Exporting chart as PDF is not supported as an inbuilt feature as of now. However, using third party libraries like jsPDF, you can export chart as PDF. If you could share JSFiddle reproducing the issue you are facing along with the library you are using for exporting, we can look into the possible issue and help you achieve your requirement.
———
Manoj Mohan
Team CanvasJS
We are looking into your query and will get back to you at the earliest.
——
Manoj Mohan
Team CanvasJS
You can achieve the above requirement by converting the provided X and Y value to the corresponding pixel coordinates using convertValueToPixel method and positioning the crosshair over the same as shown in this JSFiddle.
———
Manoj Mohan
Team CanvasJS
Tooltip gets updated along with highlighting the datapoint based on current mouse x-coordinate. It’s not possible to update based on y-coordinates, as of now. However, you can workaround this by rotating the chart-container and using secondary axisX instead of primary as shown in this JSFiddle.
—
Manoj Mohan
Team CanvasJS
You can use scaleBreaks to remove the unnecessary regions within chart plot-area. Please take a look at this JSFiddle.
—
Manoj Mohan
Team CanvasJS
Please take a look at this JSFiddle.
Considering this thread as duplicate of show crosshair and shared tooltip value on y axis time and x axis value and closing the same.
—
Manoj Mohan
Team CanvasJS
As of now, axisY supports number but not date-time. However you can work-around it by passing timestamp and formatting it in label and toolTip. Please take a look at this JSFiddle.
If you are still facing any issue, kindly share JSFiddle reproducing the issue so that we can understand the scenario better and help you out.
—
Manoj Mohan
Team CanvasJS