Skip to content

Commit 7128fcb

Browse files
committed
Fixed Sample: Minor text fixes
1 parent 201bfcd commit 7128fcb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/app/fusioncharts/ex16/ex16.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class Ex16 {
2525

2626
// Format message
2727
getMessage(datasetname, startvalue, finalvalue, label){
28-
return `<b style='font-weight:bold';>${datasetname}</b> dataset, its previous value was <b style='font-weight:bold'>${startvalue}</b> and its current value is <b style='font-weight:bold'>${finalvalue}</b> for year ${label}`;
28+
return `<b style='font-weight:bold';>${datasetname}</b> dataset, its previous value was <b style='font-weight:bold'>${startvalue}</b> and its current value is <b style='font-weight:bold'>${finalvalue}</b> for year <b>${label} </b>`;
2929
}
3030

3131
constructor(private zone: NgZone) {

src/app/fusioncharts/samplecode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ fcDemos['ex16'] = {
264264
title: 'Special Events',
265265
description: 'Drag a column to see its change',
266266
module: `// Setup needed in app.module.ts\n\nimport { NgModule, enableProdMode } from '@angular/core'\nimport { AppComponent } from './app.component';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { FusionChartsModule } from 'angular-fusioncharts';\n\n// Load FusionCharts\nimport * as FusionCharts from 'fusioncharts';\n// Load PowerCharts module\nimport * as Powercharts from 'fusioncharts/fusioncharts.powercharts';\n// Load fusion theme\nimport * as FusionTheme from 'fusioncharts/themes/fusioncharts.theme.fusion';\n\n// Add dependencies to FusionChartsModule\nFusionChartsModule.fcRoot(FusionCharts, Powercharts, FusionTheme);\n\n@NgModule({\n declarations: [\n AppComponent\n ],\n imports: [\n BrowserModule,\n FusionChartsModule\n ],\n providers: [\n ],\n bootstrap: [ AppComponent ]\n})\nexport class AppModule {\n}\n`,
267-
component: `// In app.component.ts\nimport {\n Component,\n NgZone\n} from '@angular/core';\n\n@Component({\n selector: 'app',\n templateUrl: './app.component.html'\n})\nexport class AppComponent {\n dataSource: any;\n datasetname: any;\n startvalue: any;\n finalvalue: any;\n message: any;\n\n // Format message\n getMessage(datasetname, startvalue, finalvalue, label){\n return \`<b style='font-weight:bold';>\${datasetname}</b> dataset, its previous value was <b style='font-weight:bold'>\${startvalue}</b> and its current value is <b style='font-weight:bold'>\${finalvalue}</b> for year \${label}\`;\n }\n\n constructor(private zone: NgZone) {\n this.dataSource = {\n "chart": {\n "caption": "Android and iOS Devices Sales Projections",\n "subCaption": "Drag the top of columns to adjust projections for 2017 & 2018",\n "numberPrefix": "$",\n "numberSuffix": "M",\n "yaxismaxvalue": "200",\n "theme": "fusion",\n "plotToolText": "<b>$label</b><br>$seriesName: <b>$dataValue</b>"\n },\n "categories": [{\n "category": [{\n "label": "2014",\n "fontItalic": "0"\n }, {\n "label": "2015",\n "fontItalic": "0"\n }, {\n "label": "2016",\n "fontItalic": "0"\n }, {\n "label": "2017 (Projected)"\n }, {\n "label": "2018 (Projected)"\n }]\n }],\n "dataset": [{\n "seriesname": "Android Devices",\n "data": [{\n "value": "73",\n "alpha": "100",\n "allowDrag": "0"\n }, {\n "value": "80",\n "alpha": "100",\n "allowDrag": "0"\n }, {\n "value": "97",\n "alpha": "100",\n "allowDrag": "0"\n }, {\n "value": "110",\n "toolText": "<b>$label</b><br>$seriesName: <b>$dataValue</b>"\n }, {\n "value": "180",\n "toolText": "<b>$label</b><br>$seriesName: <b>$dataValue</b>"\n }]\n }, {\n "seriesname": "iOS Devices",\n "data": [{\n "value": "63.2",\n "alpha": "100",\n "allowDrag": "0"\n }, {\n "value": "68",\n "alpha": "100",\n "allowDrag": "0"\n }, {\n "value": "82",\n "alpha": "100",\n "allowDrag": "0"\n }, {\n "value": "99",\n "toolText": "<b>$label</b><br>$seriesName: <b>$dataValue</b>"\n }, {\n "value": "150",\n "toolText": "<b>$label</b><br>$seriesName: <b>$dataValue</b>"\n }]\n }]\n };\n\n this.message = "Drag any column for years 2017 or 2018 to see updated value along with the label";\n }\n\n dragStart($event){\n let dataObj = $event.dataObj;\n this.datasetname = dataObj.datasetName;\n this.startvalue = dataObj.startValue;\n }\n\n dragEnd($event){\n let dataObj = $event.dataObj;\n this.finalvalue = dataObj.endValue;\n let label = this.dataSource.categories[0].category[dataObj.dataIndex].label;\n this.zone.run(() => {\n this.message = this.getMessage(this.datasetname, this.startvalue.toFixed(2), this.finalvalue.toFixed(2), label);\n })\n }\n}\n`,
267+
component: `// In app.component.ts\nimport {\n Component,\n NgZone\n} from '@angular/core';\n\n@Component({\n selector: 'app',\n templateUrl: './app.component.html'\n})\nexport class AppComponent {\n dataSource: any;\n datasetname: any;\n startvalue: any;\n finalvalue: any;\n message: any;\n\n // Format message\n getMessage(datasetname, startvalue, finalvalue, label){\n return \`<b style='font-weight:bold';>\${datasetname}</b> dataset, its previous value was <b style='font-weight:bold'>\${startvalue}</b> and its current value is <b style='font-weight:bold'>\${finalvalue}</b> for year <b>\${label} </b>\`;\n }\n\n constructor(private zone: NgZone) {\n this.dataSource = {\n "chart": {\n "caption": "Android and iOS Devices Sales Projections",\n "subCaption": "Drag the top of columns to adjust projections for 2017 & 2018",\n "numberPrefix": "$",\n "numberSuffix": "M",\n "yaxismaxvalue": "200",\n "theme": "fusion",\n "plotToolText": "<b>$label</b><br>$seriesName: <b>$dataValue</b>"\n },\n "categories": [{\n "category": [{\n "label": "2014",\n "fontItalic": "0"\n }, {\n "label": "2015",\n "fontItalic": "0"\n }, {\n "label": "2016",\n "fontItalic": "0"\n }, {\n "label": "2017 (Projected)"\n }, {\n "label": "2018 (Projected)"\n }]\n }],\n "dataset": [{\n "seriesname": "Android Devices",\n "data": [{\n "value": "73",\n "alpha": "100",\n "allowDrag": "0"\n }, {\n "value": "80",\n "alpha": "100",\n "allowDrag": "0"\n }, {\n "value": "97",\n "alpha": "100",\n "allowDrag": "0"\n }, {\n "value": "110",\n "toolText": "<b>$label</b><br>$seriesName: <b>$dataValue</b>"\n }, {\n "value": "180",\n "toolText": "<b>$label</b><br>$seriesName: <b>$dataValue</b>"\n }]\n }, {\n "seriesname": "iOS Devices",\n "data": [{\n "value": "63.2",\n "alpha": "100",\n "allowDrag": "0"\n }, {\n "value": "68",\n "alpha": "100",\n "allowDrag": "0"\n }, {\n "value": "82",\n "alpha": "100",\n "allowDrag": "0"\n }, {\n "value": "99",\n "toolText": "<b>$label</b><br>$seriesName: <b>$dataValue</b>"\n }, {\n "value": "150",\n "toolText": "<b>$label</b><br>$seriesName: <b>$dataValue</b>"\n }]\n }]\n };\n\n this.message = "Drag any column for years 2017 or 2018 to see updated value along with the label";\n }\n\n dragStart($event){\n let dataObj = $event.dataObj;\n this.datasetname = dataObj.datasetName;\n this.startvalue = dataObj.startValue;\n }\n\n dragEnd($event){\n let dataObj = $event.dataObj;\n this.finalvalue = dataObj.endValue;\n let label = this.dataSource.categories[0].category[dataObj.dataIndex].label;\n this.zone.run(() => {\n this.message = this.getMessage(this.datasetname, this.startvalue.toFixed(2), this.finalvalue.toFixed(2), label);\n })\n }\n}\n`,
268268
template: `<!-- in app.component.html -->\n<fusioncharts\n type="dragcolumn2d"\n width="100%"\n height="400"\n dataFormat="json"\n [dataSource]="dataSource"\n (dataplotDragStart)="dragStart($event)"\n (dataplotDragEnd)="dragEnd($event)">\n</fusioncharts>\n<p style="padding: 10px;background:#f5f2f0">{{message}}</p>\n`
269269
};
270270

0 commit comments

Comments
 (0)