|
26 | 26 | * <li>.tooltipFn(d) - user defined function to customize the tool tip (optional)
|
27 | 27 | * <li>.centerLabelFn - user defined function to customize the text of the center label (optional)
|
28 | 28 | * <li>.onClickFn(d,i) - user defined function to handle when donut arc is clicked upon.
|
| 29 | + * <li>.label - object containing properties for external label (optional) |
| 30 | + * <ul> |
| 31 | + * <li>.orientation - string with possible values: 'left', 'right' (optional) |
| 32 | + * <li>.title - string representing a prefix or title (optional) |
| 33 | + * <li>.label - similar in to the center-label parameter, which specifies the contents of the donut's external label, values: 'used', 'available', 'percent', 'none' (optional) |
| 34 | + * <li>.units - unit label for values, ex: 'MHz','GB', etc.. (optional) |
| 35 | + * <li>.labelFn - function to customize the text of the external label (optional) |
| 36 | + * </ul> |
| 37 | + * </li> |
29 | 38 | * </ul>
|
30 | 39 | *
|
31 | 40 | * @param {object} data the Total and Used values for the donut chart. Available is calculated as Total - Used.<br/>
|
|
62 | 71 | <div class="row">
|
63 | 72 | <div class="col-md-3 text-center">
|
64 | 73 | <label>Error Threshold</label>
|
65 |
| - <pf-donut-pct-chart config="configErr" data="dataErr" chart="chartErr"></pf-donut-pct-chart> |
| 74 | + <p class="text-right"> |
| 75 | + <pf-donut-pct-chart config="configErr" data="dataErr" chart="chartErr"></pf-donut-pct-chart> |
| 76 | + </p> |
66 | 77 | </div>
|
67 | 78 | <div class="col-md-3 text-center"">
|
68 | 79 | <label>Warning Threshold</label>
|
69 | 80 | <pf-donut-pct-chart config="configWarn" data="dataWarn"></pf-donut-pct-chart>
|
70 | 81 | </div>
|
71 | 82 | <div class="col-md-3 text-center"">
|
72 | 83 | <label class="camelcase">{{threshLabel}} Threshold</label>
|
73 |
| - <pf-donut-pct-chart config="configDynamic" data="dataDynamic" center-label="labelDynamic" |
74 |
| - on-threshold-change="thresholdChanged(threshold)"> |
75 |
| - </pf-donut-pct-chart> |
| 84 | + <p class="text-left"> |
| 85 | + <pf-donut-pct-chart config="configDynamic" data="dataDynamic" center-label="labelDynamic" |
| 86 | + on-threshold-change="thresholdChanged(threshold)"> |
| 87 | + </pf-donut-pct-chart> |
| 88 | + </p> |
76 | 89 | </div>
|
77 | 90 | <div class="col-md-3 text-center"">
|
78 | 91 | <label>No Threshold</label>
|
|
147 | 160 | $scope.configErr = {
|
148 | 161 | 'chartId': 'chartErr',
|
149 | 162 | 'units': 'GB',
|
150 |
| - 'thresholds':{'warning':'60','error':'90'} |
| 163 | + 'thresholds':{'warning':'60','error':'90'}, |
| 164 | + 'label': { |
| 165 | + 'orientation': 'left', |
| 166 | + 'title': 'Example', |
| 167 | + 'label': 'used', |
| 168 | + 'units': 'GB' |
| 169 | + }, |
| 170 | + 'size': { |
| 171 | + 'height': 85, |
| 172 | + 'width': 85 |
| 173 | + }, |
| 174 | + 'centerLabelFn': function () { |
| 175 | + return $scope.dataErr.used + "GB"; |
| 176 | + } |
151 | 177 | };
|
152 | 178 |
|
153 | 179 | $scope.dataErr = {
|
|
160 | 186 | $scope.configWarn = {
|
161 | 187 | 'chartId': 'chartWarn',
|
162 | 188 | 'units': 'GB',
|
163 |
| - 'thresholds':{'warning':'60','error':'90'} |
| 189 | + 'thresholds':{'warning':'60','error':'90'}, |
| 190 | + 'label': { |
| 191 | + 'label': 'used', |
| 192 | + 'units': 'GB' |
| 193 | + }, |
| 194 | + 'size': { |
| 195 | + 'height': 115, |
| 196 | + 'width': 115 |
| 197 | + }, |
| 198 | + 'centerLabelFn': function () { |
| 199 | + return $scope.dataWarn.used + "GB"; |
| 200 | + } |
164 | 201 | };
|
165 | 202 |
|
166 | 203 | $scope.dataWarn = {
|
|
171 | 208 | $scope.configDynamic = {
|
172 | 209 | 'chartId': 'chartOk',
|
173 | 210 | 'units': 'GB',
|
174 |
| - 'thresholds':{'warning':'60','error':'90'} |
| 211 | + 'thresholds':{'warning':'60','error':'90'}, |
| 212 | + 'label': { |
| 213 | + 'orientation': 'right', |
| 214 | + 'labelFn': function () { |
| 215 | + return "<strong>Custom</strong><br/>" + $scope.dataDynamic.used + " GB used"; |
| 216 | + } |
| 217 | + }, |
| 218 | + 'size': { |
| 219 | + 'height': 85, |
| 220 | + 'width': 85 |
| 221 | + }, |
| 222 | + 'centerLabelFn': function () { |
| 223 | + return $scope.dataDynamic.percent + "%"; |
| 224 | + } |
175 | 225 | };
|
176 | 226 |
|
177 | 227 | $scope.dataDynamic = {
|
|
201 | 251 | $scope.configNoThresh = {
|
202 | 252 | 'chartId': 'chartNoThresh',
|
203 | 253 | 'units': 'GB',
|
| 254 | + 'label': { |
| 255 | + 'label': 'available', |
| 256 | + 'units': 'GB' |
| 257 | + }, |
| 258 | + 'size': { |
| 259 | + 'height': 115, |
| 260 | + 'width': 115 |
| 261 | + } |
204 | 262 | };
|
205 | 263 |
|
206 | 264 | $scope.dataNoThresh = {
|
|
289 | 347 | </file>
|
290 | 348 | </example>
|
291 | 349 | */
|
| 350 | + |
0 commit comments