Logarithmic Axis

The sample shows a scenario with logarithmic axis.

import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './styles.css'; // import * as chart from '@grapecity/wijmo.chart'; import * as analytics from '@grapecity/wijmo.chart.analytics'; import * as animation from '@grapecity/wijmo.chart.animation'; import { getData } from './data'; // document.readyState === 'complete' ? init() : window.onload = init; // function init() { let linechart = new chart.FlexChart('#chart', { header: 'Logarithmic Axis', legend: { position: chart.Position.None }, chartType: chart.ChartType.Scatter, bindingX: 'x', series: [{ binding: 'y' }], axisX: { logBase: 10 }, itemsSource: getData(), palette: getRandomPalette() }); // let ani = new animation.ChartAnimation(linechart); // linechart.series.push(new analytics.TrendLine({ name: 'Trendline', binding: 'y', sampleCount: 100 })); } // function getRandomPalette() { let palettes = Object.getOwnPropertyNames(chart.Palettes) .filter(prop => typeof chart.Palettes[prop] === "object" && prop !== 'prototype'); let rand = Math.floor(Math.random() * palettes.length); // return chart.Palettes[palettes[rand]]; } <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Wijmo FlexChart Logarithmic Axis</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('./src/app'); </script> </head> <body> <div class="container-fluid"> <div id="chart"></div> </div> </body> </html> export function getData() { return [ { x: 4, y: 100 }, { x: 10, y: 2000 }, { x: 35, y: 2500 }, { x: 60, y: 4000 }, { x: 75, y: 5000 }, { x: 90, y: 6500 }, { x: 110, y: 8000 }, { x: 150, y: 9000 }, { x: 200, y: 10000 }, { x: 350, y: 15000 }, { x: 500, y: 20000 }, { x: 600, y: 25000 }, { x: 750, y: 30000 }, { x: 900, y: 40000 }, { x: 1000, y: 45000 } ]; } body { margin-bottom: 24px; } import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './styles.css'; // import * as wjChart from '@grapecity/wijmo.chart'; import { Component, Inject, enableProdMode, NgModule } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { BrowserModule } from '@angular/platform-browser'; import { WjChartModule } from '@grapecity/wijmo.angular2.chart'; import { WjChartAnalyticsModule } from '@grapecity/wijmo.angular2.chart.analytics'; import { WjChartAnimationModule } from '@grapecity/wijmo.angular2.chart.animation'; import { DataService } from './app.data'; // @Component({ selector: 'app-component', templateUrl: 'src/app.component.html' }) export class AppComponent { data: any; palette: string[]; // constructor(@Inject(DataService) private dataService: DataService) { this.data = dataService.getData(); this.palette = this._getRandomPalette(); } // private _getRandomPalette() { let palettes = Object.getOwnPropertyNames(wjChart.Palettes) .filter(prop => typeof wjChart.Palettes[prop] === "object" && prop !== 'prototype'); let rand = Math.floor(Math.random() * palettes.length); // return wjChart.Palettes[palettes[rand]]; } } // @NgModule({ imports: [WjChartModule, WjChartAnalyticsModule, WjChartAnimationModule, BrowserModule], declarations: [AppComponent], providers: [DataService], bootstrap: [AppComponent] }) export class AppModule { } // enableProdMode(); // Bootstrap application with hash style navigation and global services. platformBrowserDynamic().bootstrapModule(AppModule); <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Wijmo FlexGrid Logarithmic Axis</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Polyfills --> <script src="node_modules/core-js/client/shim.min.js"></script> <script src="node_modules/zone.js/dist/zone.min.js"></script> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.js"></script> <script src="systemjs.config.js"></script> <script> // workaround to load 'rxjs/operators' from the rxjs bundle System.import('rxjs').then(function (m) { System.set(SystemJS.resolveSync('rxjs/operators'), System.newModule(m.operators)); System.import('./src/app.component'); }); </script> </head> <body> <app-component></app-component> </body> </html> <div class="container-fluid"> <wj-flex-chart [itemsSource]="data" [header]="'Logarithmic Axis'" [bindingX]="'x'" [chartType]="'Scatter'" [palette]="palette"> <wj-flex-chart-series [binding]="'y'"></wj-flex-chart-series> <wj-flex-chart-trend-line name="Trendline" binding="y" [sampleCount]="100"></wj-flex-chart-trend-line> <wj-flex-chart-axis [wjProperty]="'axisX'" [logBase]="10"></wj-flex-chart-axis> <wj-flex-chart-animation></wj-flex-chart-animation> </wj-flex-chart> </div> import { Injectable } from '@angular/core'; // @Injectable() export class DataService { getData() { return [ { x: 4, y: 100 }, { x: 10, y: 2000 }, { x: 35, y: 2500 }, { x: 60, y: 4000 }, { x: 75, y: 5000 }, { x: 90, y: 6500 }, { x: 110, y: 8000 }, { x: 150, y: 9000 }, { x: 200, y: 10000 }, { x: 350, y: 15000 }, { x: 500, y: 20000 }, { x: 600, y: 25000 }, { x: 750, y: 30000 }, { x: 900, y: 40000 }, { x: 1000, y: 45000 } ]; } } body { margin-bottom: 24px; } <template> <div class="container-fluid"> <wj-flex-chart :itemsSource="data" header="Logarithmic Axis" bindingX="x" chartType="Scatter" :palette="palette"> <wj-flex-chart-series binding="y"></wj-flex-chart-series> <wj-flex-chart-trend-line name="Trendline" binding="y" :sampleCount=100></wj-flex-chart-trend-line> <wj-flex-chart-axis wjProperty="axisX" :logBase=10></wj-flex-chart-axis> <wj-flex-chart-animation></wj-flex-chart-animation> </wj-flex-chart> </div> </template> <script> import '@grapecity/wijmo.styles/wijmo.css'; import 'bootstrap.css'; import Vue from 'vue'; import * as wjChart from '@grapecity/wijmo.chart'; import '@grapecity/wijmo.vue2.chart'; import '@grapecity/wijmo.vue2.chart.analytics'; import '@grapecity/wijmo.vue2.chart.animation'; import { getData } from './data'; // new Vue({ el: '#app', data: { data: getData(), // Get random palette palette: (() => { let palettes = Object.getOwnPropertyNames(wjChart.Palettes) .filter(prop => typeof wjChart.Palettes[prop] === "object" && prop !== 'prototype'); let rand = Math.floor(Math.random() * palettes.length); // return wjChart.Palettes[palettes[rand]]; })() } }); </script> <style> body { margin-bottom: 24px; } </style> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Wijmo FlexChart Logarithmic Axis</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('./src/app.vue'); </script> </head> <body> <div id="app"></div> </body> </html> export function getData() { return [ { x: 4, y: 100 }, { x: 10, y: 2000 }, { x: 35, y: 2500 }, { x: 60, y: 4000 }, { x: 75, y: 5000 }, { x: 90, y: 6500 }, { x: 110, y: 8000 }, { x: 150, y: 9000 }, { x: 200, y: 10000 }, { x: 350, y: 15000 }, { x: 500, y: 20000 }, { x: 600, y: 25000 }, { x: 750, y: 30000 }, { x: 900, y: 40000 }, { x: 1000, y: 45000 } ]; } import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './app.css'; // import * as React from 'react'; import * as ReactDOM from 'react-dom'; // import * as wjChart from '@grapecity/wijmo.react.chart'; import * as chart from '@grapecity/wijmo.chart'; import * as wjChartAnalytics from '@grapecity/wijmo.react.chart.analytics'; import * as wjChartAnimate from '@grapecity/wijmo.react.chart.animation'; import { getData } from './data'; // class App extends React.Component { constructor(props) { super(props); this._getRandomPalette = () => { let palettes = Object.getOwnPropertyNames(chart.Palettes) .filter(prop => typeof chart.Palettes[prop] === "object" && prop !== 'prototype'); let rand = Math.floor(Math.random() * palettes.length); // return chart.Palettes[palettes[rand]]; }; this.state = { data: getData(), palette: this._getRandomPalette() }; } render() { return <div className="container-fluid"> <wjChart.FlexChart itemsSource={this.state.data} header="Logarithmic Axis" bindingX="x" chartType="Scatter" palette={this.state.palette}> <wjChart.FlexChartSeries binding="y"></wjChart.FlexChartSeries> <wjChartAnalytics.FlexChartTrendLine name="Trendline" binding="y" sampleCount={100}> </wjChartAnalytics.FlexChartTrendLine> <wjChart.FlexChartAxis wjProperty="axisX" logBase={10}></wjChart.FlexChartAxis> <wjChartAnimate.FlexChartAnimation></wjChartAnimate.FlexChartAnimation> </wjChart.FlexChart> </div>; } } ReactDOM.render(<App />, document.getElementById('app')); <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>AutoComplete</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('./src/app'); </script> </head> <body> <div id="app"></div> </body> </html> body { margin-bottom: 24px; } export function getData() { return [ { x: 4, y: 100 }, { x: 10, y: 2000 }, { x: 35, y: 2500 }, { x: 60, y: 4000 }, { x: 75, y: 5000 }, { x: 90, y: 6500 }, { x: 110, y: 8000 }, { x: 150, y: 9000 }, { x: 200, y: 10000 }, { x: 350, y: 15000 }, { x: 500, y: 20000 }, { x: 600, y: 25000 }, { x: 750, y: 30000 }, { x: 900, y: 40000 }, { x: 1000, y: 45000 } ]; }