customize lineChart in primefaces

戏子无情 提交于 2020-01-05 03:44:26

问题


I'm using of lineChart in primefaces on my project.

I want to customize lineChart.

how to change background color and remove grid of lineChart ?


回答1:


You can set custom design with:

<script type="text/javascript">
  function customExtender() {
    this.cfg.grid = {
       ...........
    }
  }
</script>
...
<p:lineChart extender="customExtender" value="..." />

and just check jqplot documentation http://www.jqplot.com/docs/files/jqPlotOptions-txt.html section

   grid: {
        drawGridLines: true,        // wether to draw lines across the grid or not.
        gridLineColor: '#cccccc'    // *Color of the grid lines.
        background: '#fffdf6',      // CSS color spec for background color of grid.
        borderColor: '#999999',     // CSS color spec for border around grid.
        borderWidth: 2.0,           // pixel width of border around grid.
        shadow: true,               // draw a shadow for grid.
        shadowAngle: 45,            // angle of the shadow.  Clockwise from x axis.
        shadowOffset: 1.5,          // offset from the line of the shadow.
        shadowWidth: 3,             // width of the stroke for the shadow.
        shadowDepth: 3,             // Number of strokes to make when drawing shadow.
                                    // Each stroke offset by shadowOffset from the last.
        shadowAlpha: 0.07           // Opacity of the shadow
        renderer: $.jqplot.CanvasGridRenderer,  // renderer to use to draw the grid.
        rendererOptions: {}         // options to pass to the renderer.  Note, the default
                                    // CanvasGridRenderer takes no additional options.
    },

you can see background param and drawGridLines there :)



来源:https://stackoverflow.com/questions/23823353/customize-linechart-in-primefaces

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!