Comments (3)
My mistake. I had some additional ',' in my data. The component does not give error. So, I totally ignored it. Sorry about that.
It works well with Angular 8.
from timelines-chart.
@ishwara-bhat Could you please share the working example with angular 8
from timelines-chart.
I have something like this .
//timelinewrapper.ts
import { Component, OnInit, Input, SimpleChanges } from '@angular/core';
import { ElementRef, Renderer2, AfterViewInit, ViewChild } from '@angular/core';
import * as d3 from 'd3';
import TimelinesChart from 'timelines-chart';
@Component({
selector: 'app-time-line-wrap',
templateUrl: './time-line-wrap.component.html',
styleUrls: ['./time-line-wrap.component.scss']
})
export class TimeLineWrapComponent implements OnInit {
private elRef: any;
mychart = TimelinesChart();
inputDataDomain = ['labelval1', 'labelval2', 'labelval3', 'labelval4', 'labelval5'];
inputDataRange = ['red', 'green', 'grey', 'blue', 'brown'];
controlwidth: integer = 1000;
public inputData: any = //Reference data
[
{
group: "group1",
data: [
{
label: "label1",
data:
[
{
timeRange: [1, 2],
val: 'labelval1'
},
{
timeRange: [2, 3],
val: 'labelval2'
},
{
timeRange: [6, 7],
val: 'labelval3'
},
{
timeRange: [7, 8],
val: 'labelval4'
},
{
timeRange: [11, 12],
val: 'labelval5'
},
{
timeRange: [12, 13],
val: 'labelval6'
}
]
},
]
},
{...}]
ngOnInit() {
this.mychart
.data(this.inputData)
.zScaleLabel('My Labels')
.zQualitative(true)
.xTickFormat(n => +n)
.timeFormat('%Q')
.maxLineHeight(20)
.width(this.controlwidth)
.topMargin(30)
//(this.chartspanContainer.nativeElement);
(this.elRef.nativeElement);
this.mychart.zColorScale(d3.scaleOrdinal().domain(this.inputDataDomainfromOutside).range(this.inputDataRangefromOutside));
}
ngOnChanges(changes: SimpleChanges) {
console.log("Data simple change event at child chart" + changes)
this.mychart
.data(this.inputData);
console.log(this.inputData);
this.mychart.zColorScale(d3.scaleOrdinal().domain(this.inputDataDomain).range(this.inputDataRange));
}
from timelines-chart.
Related Issues (20)
- Error: <rect> attribute width: A negative value is not valid. ("-190") HOT 1
- Duplicate labels HOT 1
- How to do Multiple Selection of Timeline Segments using Cursor Drag (click+Drag) and Handling the selection of those segments to store the info and update their UI based on our logic
- some entries appear in wrong group row HOT 2
- Feature Request for SortChrono
- Custom Tooltip with custom value. HOT 1
- Feature Request: onChartRendered
- How to use enableOverview() HOT 1
- Custom messages - changed from 2.11.5 to 2.11.8? HOT 1
- onScaleUnitClick HOT 2
- Series segments not being created on firefox HOT 3
- Coloring individual (overlapping) segments HOT 2
- "Fill" option for chart sizing HOT 1
- Set the timeline height HOT 2
- Text on Segments
- Line datetime from zero
- Blue tooltips do not disappear
- User defined group label width
- Mark the weekends on the chart
- Uncaught runtime errors; it happened sometimes (when I click for loading data quickly) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timelines-chart.