| 12 | You can view these svg graphs in in a webpage using an <object> tag. So: |
| 13 | * <object data="http://127.0.0.1:8000/eden/cr/shelter/barchart.svg?value=capacity" width="600" height="400" /> |
| 14 | |
| 15 | == Parameters for the S3XRC method == |
| 16 | |
| 17 | The URL requires a single parameter: |
| 18 | * '''value''' Specifies which field of the resource contains the value to graph |
| 19 | |
| 20 | The URL takes a number of optional parameters to make graphs more presentable: |
| 21 | * '''name''' Specifies which field of the resource is used to label bars on the x axis of the graph |
| 22 | * '''start''' The first record in the set to graph (start=2 will not graph first record in the set) |
| 23 | * '''limit''' The number of records in the set to graph |
| 24 | * '''settings''' A JSON object of settings to change the appearance of the graph (ie settings={"barColor": "0A0AE0"}) |
| 25 | |
| 26 | You '''start''' and '''limit''' to keep the number of bars manageable. If resource set contains too many records, you may need to limit your results to get a meaningful graph. |
| 27 | |
| 28 | == Settings == |
| 29 | |
| 30 | There are number of settings that you can use to change the appearance of bar graph. The format is settings={"settingName1": "settingValue1", "settingName2": "settingValue2", ...} |
| 31 | Some available settings and the type of parameter they take : |
| 32 | * '''barColor''' ''hex color (ie 00AAEE)'' - The color of the bars |
| 33 | * '''barWidth''' ''float'' - The relative width of each bar |
| 34 | * '''barSpacing''' ''float'' - The relative spacing between bars |
| 35 | * '''xAxisSpace''' ''float'' - The spacing between the canvas and the x axis |
| 36 | * '''yAxisSpace''' ''float'' - The spacing between the canvas and the y axis |
| 37 | * '''xAxisTextHeight''' ''float'' - The height of the x-axis text |
| 38 | * '''yAxisTextHeight''' ''float'' - The height of the y-axis text |
| 39 | * '''canvasBorder''' ''boolean'' - If a border is drawn around the canvas |
| 40 | * '''canvasBorderWidth''' ''float'' - The width of the canvas border |
| 41 | * '''canvasBorderColor''' ''hex color'' - The color of the canvas border |
| 42 | * '''More coming soon...''' |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |