UNPKG

dojox

Version:

Dojo eXtensions, a rollup of many useful sub-projects and varying states of maturity – from very stable and robust, to alpha and experimental. See individual projects contain README files for details.

100 lines (98 loc) 4.45 kB
<!DOCTYPE HTML> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Filters</title> <style type="text/css"> @import "../../../dojo/resources/dojo.css"; @import "../../../dijit/tests/css/dijitTests.css"; </style> <!-- required for Tooltip: a default dijit theme: --> <link rel="stylesheet" href="../../../dijit/themes/tundra/tundra.css"> <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="isDebug: true, async: true, parseOnLoad: true"></script> <script type="text/javascript"> var seriesB = [2.6, 1.8, 2, 1, 1.4, 0.7, 2]; var dropShadow; var dropShadowBar; var dropShadowLine; require([ "dojox/gfx/filters", "dojox/gfx/svgext", "dojox/charting/widget/Chart", "dojox/charting/axis2d/Default", "dojox/charting/plot2d/Columns", "dojox/charting/plot2d/Bars", "dojox/charting/plot2d/Default", "dojox/charting/plot2d/Pie", "dojox/charting/action2d/Shake", "dojox/charting/themes/PlotKit/orange", "dojox/charting/themes/PlotKit/blue", "dojox/charting/themes/PlotKit/green", "dojo/parser"], function(filters){ dropShadow = filters.shadows.dropShadow({id: "ds" }); dropShadowBar = filters.createFilter({ id: "dsb", x: "-10%", y: "-10%", width: "125%", height: "125%" }, [ filters.feGaussianBlur({"in":"SourceAlpha","stdDeviation":4}), filters.feOffset({"dx":-5,"dy":5,"result":"offsetBlur"}), filters.feMerge("offsetBlur","SourceGraphic") ]); dropShadowLine = filters.createFilter({ id: "dsl", x: "2%", y: "2%", width: "98%", height: "98%" }, [ filters.feGaussianBlur({"in":"SourceAlpha","stdDeviation":2}), filters.feOffset({"dx":2,"dy":2,"result":"offsetBlur"}), filters.feMerge("offsetBlur","SourceGraphic") ]); });; </script> </head> <body class="tundra"> <h1>Shadows</h1> <p>Testing charts shadows</p> <table border="0" cellspacing="30"> <tr> <td> <div data-dojo-type="dojox.charting.widget.Chart" id="chart1" style="width: 300px; height: 300px;"> <div class="axis" name="y" font="italic normal normal 8pt Tahoma" natural="true" fixLower="major" fixUpper="major"></div> <div class="axis" name="x" vertical="true" fixUpper="major" includeZero="true" font="italic normal normal 8pt Tahoma"></div> <div class="plot" name="default" type="Bars" fill="'red'" filter="dropShadowBar" stroke="null" gap="5" animate="true"></div> <div class="series" name="Run A" data="1, 2, 0.5, 1.5, 1, 2.8, 0.4"></div> <div class="action" type="Shake"></div> </div> </td> <td> <div data-dojo-type="dojox.charting.widget.Chart" id="chart2" style="width: 300px; height: 300px;"> <div class="axis" name="x" font="italic normal normal 8pt Tahoma" natural="true" fixLower="major" fixUpper="major"></div> <div class="axis" name="y" vertical="true" fixUpper="major" includeZero="true" font="italic normal normal 8pt Tahoma"></div> <div class="plot" name="default" type="Columns" fill="'red'" filter="dropShadow" stroke="null" gap="5" animate="true"></div> <div class="series" name="Run A" data="1, 2, 0.5, 1.5, 1, 2.8, 0.4"></div> <div class="action" type="Shake"></div> </div> </td> </tr> <tr> <td> <div data-dojo-type="dojox.charting.widget.Chart" id="chart3" theme="dojox.charting.themes.PlotKit.blue" style="width: 300px; height: 300px;"> <div class="plot" name="default" type="Pie" radius="100" fontColor="white" filter="dropShadow" animate="true"></div> <div class="series" name="Series B" array="seriesB"></div> <div class="action" type="Shake"></div> </div> </td> <td> <div data-dojo-type="dojox.charting.widget.Chart" id="chart4" style="width: 300px; height: 300px;"> <div class="axis" name="x" font="italic normal normal 8pt Tahoma" natural="true" fixLower="major" fixUpper="major"></div> <div class="axis" name="y" vertical="true" fixUpper="major" includeZero="true" font="italic normal normal 8pt Tahoma"></div> <div class="plot" name="default" type="Default" stroke="{width: 4, color: 'red'}" filter="dropShadowLine" animate="true"></div> <div class="series" name="Run A" data="1, 2, 0.5, 1.5, 1, 2.8, 0.4"></div> </div> </td> </tr> </table> <p>That's all Folks!</p> </body> </html>