|
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>.labelConfig - object containing properties for external label (optional) - default: undefined |
| 30 | + * <ul> |
| 31 | + * <li>.orientation - string with possible values: 'left', 'right' (optional) - default: 'center' |
| 32 | + * <li>.title - string representing a prefix or title (optional) - default: empty string |
| 33 | + * <li>.label - the wording format to display, possible values: 'used', 'available', 'percent', 'none' (optional) - default: 'used' |
| 34 | + * <li>.units - unit label for values, ex: 'MHz','GB', etc.. (optional) - default: empty string |
| 35 | + * <li>.labelFn - function to customize the text of the external label (optional) - default: undefined |
| 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 |
| - <div class="col-md-3 text-center""> |
| 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 |
| - <div class="col-md-3 text-center""> |
| 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 |
| - <div class="col-md-3 text-center""> |
| 90 | + <div class="col-md-3 text-center"> |
78 | 91 | <label>No Threshold</label>
|
79 | 92 | <pf-donut-pct-chart config="configNoThresh" data="dataNoThresh"></pf-donut-pct-chart>
|
80 | 93 | </div>
|
|
120 | 133 | </div>
|
121 | 134 | <div class="row">
|
122 | 135 | <div class="col-md-3">
|
123 |
| - <form role="form""> |
| 136 | + <form role="form"> |
124 | 137 | <div class="form-group">
|
125 | 138 | <label class="checkbox-inline">
|
126 | 139 | <input type="checkbox" ng-model="custData.dataAvailable">Data Available</input>
|
|
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 | + 'labelConfig': { |
| 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 | + 'labelConfig': { |
| 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 | + 'labelConfig': { |
| 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 | + 'labelConfig': { |
| 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