HOW TO MAKE JQPLOT RESPONSIVE

本文介绍如何使用jqPlot创建响应式图表。通过监听窗口大小变化并调用replot()方法,可以使图表随窗口尺寸变化而调整。具体实现方法包括设置jQuery事件处理程序以确保图表在窗口调整大小时重新绘制。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

HOW TO MAKE JQPLOT RESPONSIVE

jqPlot is a plotting and charting plugin for the jQuery Javascript framework. jqPlot produces beautiful line, bar and pie charts with many features.

To make JqPlot responsive we need to replot() the graph on change on window size. Here is how you should do it…

Using the replot() function this can be achieved, as done at this fiddle link. Read more on replot andredraw from here.

 

$(document).ready(function(){
    plot1 = $.jqplot ('chart', [[3,7,9,1,4,6,8,2,5]]);
    window.onresize = function(event) {
        plot1.replot();
    }
});

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值