Skip to content

Commit 6e72fcb

Browse files
author
Olivier Giulieri
committed
Added "typechart" attribute to fields.
1 parent 86f956d commit 6e72fcb

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

doc/ui-model.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ <h1>field</h1>
217217
<tr>
218218
<th colspan="2">Layout</th>
219219
</tr>
220+
<tr>
221+
<td>typechart<span class="evol-asterix">*</span>
222+
</td>
223+
<td>Type of chart used for this fields (in Charts view). Possible values: Pie, vBar, hBar (more later).
224+
<br>Note: Only applies for fields which supports charts (fields of type boolean, integer, money, lov).
225+
</td>
226+
</tr>
220227
<tr>
221228
<td >css<span class="evol-asterix">*</span>
222229
</td>
@@ -450,7 +457,7 @@ <h1>panel</h1>
450457
<section>
451458
<h1>panel-list</h1>
452459

453-
<p>Similar to a panel but used to display a sub-collection (an array of objects).</p>
460+
<p>Similar to a panel but used to display a sub-collection (an array of objects). It is the "details" part in a "master-details" (and can have multiple details).</p>
454461

455462
<table class="table table-bordered">
456463
<tbody>

js/many-charts.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ Evol.ViewMany.Charts = Evol.ViewMany.extend({
4848
uiModel = this.uiModel,
4949
models = this.collection.models,
5050
iconsPath = this.iconsPath || '',
51-
chartFields = this.getFields();
51+
chartFields = this.getFields(),
52+
chartType;
5253

5354
if(chartFields && chartFields.length){
5455
var groups,
@@ -97,9 +98,10 @@ Evol.ViewMany.Charts = Evol.ViewMany.extend({
9798
labels.push(lb+' ('+nb+')');
9899
}
99100
}
100-
if(f.type===fTypes.lov){
101+
chartType = f.typechart || (f.type===fTypes.lov ? 'pie':'bars');
102+
if(chartType==='pie'){
101103
h.push(EvoUI.Charts.Pie(f.labelcharts?f.labelcharts:i18n.getLabel('charts.aByB', entityName, f.label), data, labels, style, sizes));
102-
}else{
104+
}else if(chartType==='bars'){
103105
h.push(EvoUI.Charts.Bars(f.labelcharts?f.labelcharts:i18n.getLabel('charts.aB', entityName, f.label), data, labels, style, sizes));
104106
}
105107
});

0 commit comments

Comments
 (0)