Jschart Lightweight graphical reporting tool (built-in function Chinese reference) _javascript tips

Source: Internet
Author: User
Tags border color extend
Because there's not a lot of articles on the web about this framework, and it is not very good for Chinese support, manuals and everything is in English, although not many, but given that some novice may not have the time and energy to read the reference manual, in order to let more friends understand it, so after work on the approximate translation of its built-in functions, Because the time is hasty, some places translation very probably, also unavoidably mixed some mistakes, is a kind of a reference, hoped that everybody does not understand the place to test personally, the reference its official provides the example to be easy to start.

Jschart built-in Function Reference

Colorizebars (array colordata) sets the rectangle color of the column chart.
Colorizepie (array Colordata) sets the block color for the pie chart.
Draw () in the end, after the items are set up, perform this function to draw the chart.
Setaxiscolor (String hexcolor) sets the axis color and is not valid for pie charts. parameter is a 16-in color value.
Resize (integer x, integer y) resets the chart size, the default x/y is 400px/300px, and the new value should be an integer multiple of the default value.
Setaxisnamecolor (String hexcolor) sets the color of the axis name, which is not valid for pie charts.
Setaxisnamefontsize (integer fontsize) sets the axis name body size and is not valid for pie charts. The default is 11.
Setaxisnamex (String axisname) sets the name of the x axis, which is not valid for pie charts.
Setaxisnamey (String axisname) sets the y-axis name, which is not valid for pie charts.
Setaxispaddingbottom (integer padding) sets the distance between the x axis and the bottom of the container, by default 30.
Setaxispaddingleft (integer padding) sets the distance between the Y axis and the left margin of the container, by default 40.
Setaxispaddingright (integer padding) sets the distance to the right of the chart and the container, by default 30.
Setaxispaddingtop (integer padding) sets the distance between the top of the chart and the container, by default 30.
Setaxisvaluescolor (String hexcolor) sets the color of the x/y axis value, which is not valid for pie charts.
Setaxisvaluesdecimals (integer decimals) sets the x/y axis value of the graph, or the y-axis value of the histogram, which is not valid for the pie chart and is auto by default.
Setaxisvaluesfontsize (integer fontsize) sets the font size for values on the two axis and is not valid for pie charts.
Setaxisvaluesnumberx (integer number) sets the count of the values displayed on the x-axis, which are automatically adjusted to be invalid for pie charts.
Setaxisvaluesnumbery (integer number) sets the count of the values displayed on the x-axis, which are automatically adjusted to be invalid for pie charts.
Setaxiswidth (integer width) sets the width of the axis, which defaults to 2.
SetBackgroundColor (String hexcolor) sets the background color of the entire chart, which is #fff by default.
SetBackgroundImage (string filename) sets the background picture of the chart, and the picture is automatically duplicated along the two axes.
Setbarbordercolor (String hexcolor) sets the bar border color of a histogram, which is only valid for the histogram, and the default #c4c4c4.
Setbarborderwidth (integer width) sets the bar chart border width, which is only valid for the histogram.
Setbarcolor (String hexcolor) sets the color of all rectangles in a column chart, which is overridden by the colorize () function and is only valid for a histogram.
Setbaropacity (float opacity) Sets the transparency of the histogram, the value is between 0~1 and the default 0.9.
Setbarspacingratio (integer ratio) sets the rectangular spacing of the histogram, which controls the width of the histogram, which is the integer between 0~100, and the default is 10.
Setbarvalues (Boolean values) sets whether values are displayed at the top of the rectangle.
Setbarvaluescolor (String hexcolor) sets the color of the value of the histogram rectangle.
Setbarvaluesdecimals (integer decimals) sets the value of the rectangle height of the histogram, which is the decimal number and the default auto.
Setbarvaluesfontsize (integer fontsize) sets the font size of the histogram rectangle value, which defaults to 8.
Setcanvasidprefix (string prefix) customizes the ID prefix for the production element, which is jschart by default, and is generally not modified.
Setdataarray (array data, string ID) imports the data as an array into the chart, the ID parameter is optional, and you can set the same ID.
Setdataxml (string filename) imports the data into the diagram as XML.
Setflagcolor (String hexcolor) sets the color for the hint flag.
Setflagoffset (integer offset) Sets the offset of the hint flag and applies only to pie charts.
Setflagopacity (float opacity) Sets the transparency of the hint flag, between 0~1, the default 0.5.
Setflagradius (integer RADIUS) sets the radius of the hint flag, default 3.
Setflagwidth (integer width) sets the hint flag border width, default 1.
Setgraphextend (Boolean Extend) sets whether to turn on the chart extension feature, the default is False, and if turned on, the two axes and gridlines will extend 1/15 of the current length, which can be more aesthetically pleasing in style.
Setgraphlabel (String label) sets the custom Chart watermark label text.
Setgraphlabelcolor (String hexcolor) sets the custom Chart watermark label color.
Setgraphlabelfontsize (integer fontsize) sets the font size for the custom chart watermark label, which defaults to 8.
Setgraphlabelopacity (float opacity) Sets the transparency of a custom chart watermark label.
Setgraphlabelposition (string position) sets the position of the custom chart watermark label, in the range (NW, NE, SW, SE), positioned at Four Corners, the default NE, the upper-right corner.
Setgraphlabelshadowcolor (String hexcolor) sets the shadow color of the custom chart watermark label.
Setgrid (Boolean grid) sets whether gridlines are displayed.
Setgridcolor (String hexcolor) sets the color of the gridline, the default #c6c6c6.
Setgridopacity (float opacity) Sets the transparency of the gridlines, taking the value between 0~1 and the default 0.5.
Setintervalendx (integer end) sets the ending value of the x-axis, which must be larger than the starting value if the starting value is set.
Setintervalendy (integer end) sets the ending value of the y-axis, which must be larger than the starting value if the starting value is set.
Setintervalstartx (integer start) sets the starting value of the x-axis, which must be smaller than the end value if the end value is set.
Setintervalstarty (integer start) sets the starting value of the y-axis, which must be smaller than the end value if the end value is set.
Setlabelx (array label) adds a label on the x-axis whose argument is an array of two values, the first parameter is the position of the label on the x-axis, and the second value is what the label displays.
Setlabely (array label) adds a label on the y-axis whose argument is an array of two values, the first parameter is the position of the label on the y-axis, and the second value is what the label displays.
Setlinecolor (string hexcolor, string id) sets the color of the curves in the graph. See example Curve diagram 3.
Setlineopacity (float opacity, string id) sets the transparency of the curve in the graph, 0~1 between the values and the default 0.9. The meaning of the parameter ID is ditto.
Setlinewidth (integer width, string id) sets the width of the curve in the graph, by default 2.
Setpieopacity (float opacity) Sets the transparency of the pie chart, values 0~1, default 1.
Setpieposition (integer x, integer y) sets the position of the pie chart within the container, the default 0, which is located in the center of the container.
Setpieradius (integer RADIUS) sets the radius of the pie chart.
Setpieunitscolor (String hexcolor) sets the color of the pie tile name.
Setpieunitsfontsize (integer fontsize) sets the font size of the pie tile name.
Setpieunitsoffset (integer offset) Sets the position of the pie tile name, the integer moves out, and the negative number moves inward.
Setpievaluescolor (String hexcolor) sets the color of the pie chart value.
Setpievaluesdecimals (integer decimals) sets the total value on the pie chart.
Setpievaluesfontsize (integer fontsize) sets the font size for values on the pie chart.
Setpievaluesoffset (integer offset) Sets the offset of the value on the pie chart, the integer moves out, the negative number moves inward, and the default-20.
Whether Setshowxvalues (Boolean show) displays the tick values on the x-axis.
Whether the Setshowyvalues (Boolean show) displays the tick values on the Y axis.
SetSize (integer x, integer y) is the size of the predefined container, which is required before the draw () function.
Settextpaddingbottom (integer padding) sets the distance between the label text on the x-axis and the bottom of the container, by default 1.
Settextpaddingleft (integer padding) sets the distance between the label text on the y-axis and the left side of the container, by default 8.
Settextpaddingtop (integer padding) sets the distance between the top of the chart and the top of the container, by default 15.
Settitle (string title) sets the chart title, default "Jschart".
Settitlecolor (String Hexcolor) sets the caption color.
Settitlefontsize (integer fontsize) sets the caption font size.
Settitleposition (string position) sets the title position, the value range (center, left, right.).
SetToolTip (Array tooltip) sets the x-axis hint.
Settooltipbackground (String hexcolor) sets the hint background.
Settooltipborder (string CSS) sets the hint background border style, the parameter is a CSS expression, and the default is 1px solid #d3d3d3.
Settooltipfontcolor (String hexcolor) sets the hint content color.
Settooltipfontfamily (string font) setting prompts font style, default Arial.
Settooltipfontsize (integer fontsize) sets the prompt content font size, default 12.
Settooltipoffset (integer offset) sets the hint content offset, default 7.
Settooltipopacity (float opacity) setting prompts for transparency, default 0.7.
Settooltippadding (string css) setting prompts padding style, default 2px 5px.
Settooltipposition (string position) sets the hint position, the value range NW, NE, SW and SE default SE.

--Finished

Jschart Official website http://www.jscharts.com/has complete manuals and examples.

For Jschart does not support the drawbacks of Chinese, already have a master to provide an extension of the script, the Internet is easy to find, you can download here.
After downloading can only refer to Jscharts_mb.js, you can also refer to the Jscharts.js, and then reference Jscharts.plug.mb.js, two methods to choose one of the first.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.