ComponentOne Wijmo Charts 缩放

你可以很容易的使用ComponentOne Wijmo Charts 展示数据。这篇文章介绍怎样使用jQuery 实现Wijmo Charts 的缩放功能。
放大或者缩小 Wijmo Chart,你可以使用 CSS “zoom” 属性。首先,添加以下标记来创建 Wijmo Charts。

<table> 
    <tr> 
        <td> 
            <div id="wijbarchartContainer" style="width: 700px; height: 600px; overflow: auto"> 
                 <div id="wijbarchart"> 
                 </div> 
            </div> 
        </td> 
        <td> 
              <div id="wijpiechart"> 
              </div> 
        </td> 
    </tr> 
</table>

wijbarchartContainer 为 Wijmo Chart 的容器。

放大和缩小
我们添加两个类型为 Image 的 Input 标签。设置他们的 src 属性去放大和缩小图片。现在,仅仅通过zoom 属性(Firefox -moz-transform 属性)可以实现Wijmo Chart 的缩放操作了。

<input type="image" id="btnZoomIn" οnclick="btnZoomIn" style="height: 30px; width: 30px"
src="http://icons.iconarchive.com/icons/visualpharm/must-have/256/Zoom-In-icon.png" /> 
<input type="image" id="btnZoomOut" οnclick="btnZoomIn" style="height: 30px; width: 30px"
src="http://icons.iconarchive.com/icons/visualpharm/must-have/256/Zoom-Out-icon.png" />

currZoom = $("#wijbarchart").css("zoom"); 
if (currZoom == 'normal') currZoom = 1; 

$("#btnZoomIn").click(function () { 
currZoom *= 1.2; 
$("#wijbarchart").css("zoom", currZoom); 
$("#wijbarchart").css("-moz-transform", "Scale(" + currZoom + ")"); 
$("#wijbarchart").css("-moz-transform-origin", "0 0"); 
$("#wijpiechart").css("zoom", currZoom); 
$("#wijpiechart").css("-moz-transform", "Scale(" + currZoom + ")"); 
$("#wijpiechart").css("-moz-transform-origin", "0 0"); 
}); 

$("#btnZoomOut").click(function () { 
if (currZoom > 0.6) { 
currZoom *= 0.8; 
$("#wijbarchart").css("zoom", currZoom); 
$("#wijbarchart").css("-moz-transform", "Scale(" + currZoom + ")"); 
$("#wijbarchart").css("-moz-transform-origin", "0 0"); 
$("#wijpiechart").css("zoom", currZoom); 
$("#wijpiechart").css("-moz-transform", "Scale(" + currZoom + ")"); 
$("#wijpiechart").css("-moz-transform-origin", "0 0"); 
} 

 

截图展示:
ComponentOne Wijmo Charts 缩放
你也试一试?
Demo 下载

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ComponentOne Studio for ASP.NET Wijmo 2013 v1 2/5 共五个压缩文件,请全部下载后解压 Part of: Ultimate | Enterprise 40+ styled, supercharged, and easy-to-use controls built on Web standards including AJAX, CSS, HTML5, and jQuery. One Technology for All ASP.NET Development One Technology for All ASP.NET Development Take on any project with a single technology that provides everything from pure client-side development to robust server-side development. Empower your team with the tools they need to build engaging Web applications. ComponentOne provides the ultimate UI controls from WebForms to MVC powered by the core client technology: Wijmo. Learn more about the ComponentOne Web Stack. The Most Innovative Technology The Most Innovative Technology Your web applications will perform faster, run smoother, and be more engaging than even before. Built with HTML5, jQuery, CSS3, and SVG, Studio for ASP.NET Wijmo controls make your applications suitable for Today's Web. Effortless Application-wide Theming Effortless Application-wide Theming Easily develop a consistent look and feel across your entire application. Start by using the six professionally designed themes pre-packaged in ComponentOne’s ASP.NET Wijmo controls. Optionally, choose from over 30 themes from the jQuery UI project or use ThemeRoller from jQuery UI to create your own custom theme. Learn more about the Studio for ASP.NET Wijmo rich theming architecture or launch the ASP.NET Theme Explorer to see for yourself. Full Cross-browser Compatibility Full Cross-browser Compatibility Ensure your UI works in every browser and every device without worrying about compatibility issues. Create interactive charts that render just as well in IE6 as they do on an iPad. Studio for ASP.NET Wijmo controls support these popular browsers: IE6+, Firefox 3+, Safari 3+, and Chrome. Unmatched Performance In modern Web development, client-side download and performance are critical. With those key factors in mind, we created a new high-performance client-side framework (Wijmo). Using Studio for ASP.NET Wijmo controls you can choose whether features are executed on the client or server. Easily develop responsive applications that minimize Postbacks to the server, and experience unmatched performance with quick client-side download and scripting optimization on the client. Built-in Web Standards and Accessibility Built-in Web Standards and Accessibility Web Standards like semantic markup, progressive enhancement, and CSS styling are important elements of robust web development. Just the same, accessibility enhancements like Section 508 compliance and ARIA support are vital. Be certain your controls use Web Standards and meet strict accessibility guidelines with Studio for ASP.NET Wijmo. Premium Support Premium Support You don't have to worry about questions slowing you down. Get fast and professional help while using our tools with Premium support. From our 24-hour support response guarantee to our knowledge-rich online community, enjoy unmatched support. Complete Documentation Get started quickly by referencing in-depth documentation and samples with full source code. Searching for something specific? Take a look at the Studio for ASP.NET Wijmo documentation, which includes quick starts, tutorials, syntax, and more. Or, explore the controls by playing with the Studio for ASP.NET Wijmo demos.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值