Commit e9bc223c authored by Jenkins's avatar Jenkins
Browse files

Merge commit '0ce48865'

parents 76176830 0ce48865
......@@ -29,15 +29,15 @@ export class ChartComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChildren('containerID') queryContainerID: QueryList<ElementRef>;
@ViewChild('containerID') containerID: ElementRef;
private chartIsInit = false;
protected chartIsInit = false;
private querySubscription: Subscription;
protected querySubscription: Subscription;
private colorDefault = ['#165f10', '#58b311', '#d6df0b', '#80290f', '#0f2c80'];
protected colorDefault = ['#165f10', '#58b311', '#d6df0b', '#80290f', '#0f2c80'];
private datas = {};
protected datas = {};
private labelOnChartParam = {
protected labelOnChartParam = {
color: '#FFF',
anchor: 'center',
align: 'end',
......@@ -61,7 +61,7 @@ export class ChartComponent implements OnInit, AfterViewInit, OnDestroy {
@Input() withValueOnChart = false;
@Input() fontStyle: string;
private htmlLegendPlugin = {
protected htmlLegendPlugin = {
id: 'htmlLegend',
afterUpdate: (chart) => {
const ul = this.getOrCreateLegendList();
......@@ -186,7 +186,7 @@ export class ChartComponent implements OnInit, AfterViewInit, OnDestroy {
}
}
private buildDataSet(datas) {
protected buildDataSet(datas) {
const retour = [];
const newColor = [];
......@@ -207,7 +207,7 @@ export class ChartComponent implements OnInit, AfterViewInit, OnDestroy {
return retour;
}
private filterData(datas) {
protected filterData(datas) {
const retour = {};
const newColor = [];
Object.entries(datas).forEach(([key, value], idx) => {
......@@ -223,13 +223,13 @@ export class ChartComponent implements OnInit, AfterViewInit, OnDestroy {
return retour;
}
private barChart(ctx: HTMLCanvasElement) {
protected barChart(ctx: HTMLCanvasElement) {
const ctx2d = ctx.getContext('2d');
const dataSets = this.buildDataSet(this.datas);
this.labelOnChartParam.align = 'end';
this.labelOnChartParam.anchor = 'end';
this.labelOnChartParam.anchor = 'center';
this.labelOnChartParam.color = 'black';
this.labelOnChartParam.font.weight = 'normal';
......@@ -265,7 +265,7 @@ export class ChartComponent implements OnInit, AfterViewInit, OnDestroy {
}, );
}
private pieChart(ctx: HTMLCanvasElement) {
protected pieChart(ctx: HTMLCanvasElement) {
const ctx2d = ctx.getContext('2d');
const dataFilter = this.filterData(this.datas);
......@@ -313,7 +313,7 @@ export class ChartComponent implements OnInit, AfterViewInit, OnDestroy {
});
}
private getOrCreateLegendList() {
protected getOrCreateLegendList() {
const legendContainer = this.containerID.nativeElement;
let listContainer = legendContainer.querySelector('ul');
......
......@@ -14,7 +14,9 @@
* projection: "urn:ogc:def:crs:EPSG::2154",
* center: [563401.85717836,6792415.9857373],
* zoom: 12
* }
* },
* header: "Titre du pdf",
* footer: "Pied de page du pdf"
* }
* ```
*/
......@@ -36,6 +38,12 @@ export interface OptionImpression{
/** Pour centrer la vue de la carte sur un point */
view?: ImpressionView;
/** entête */
header: string;
/** pied de page */
footer: string;
}
export interface ImpressionView{
......
......@@ -6,16 +6,20 @@ import {toFixed} from 'ol/math';
})
export class InformationSheetFilterPipe implements PipeTransform {
transform(value: number|string|boolean, digit: number = null): number|string {
transform(value: number|string|boolean, digit: number = null, local: string = 'fr-Fr'): number|string {
if ( typeof digit === 'string' ){
digit = parseInt(digit, 10);
}
if (!value && value !== 0 && value !== false) {
return 'Données indisponibles';
} else if (value === true || value === false) {
return value ? 'Oui' : 'Non';
} else if (isFinite(value as number)) {
if (digit) {
if (digit || digit === 0) {
value = toFixed(value as number, digit);
}
return value.toLocaleString();
return value.toLocaleString(local);
} else {
return value;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment