Does angular gantt plugin allow to change the column header labels? I tried to change the side table headers but couldn't. If it doesn't allow what other gantt chart can I use? At the side table, I need to show work station, id and type. In the gannt chart, I need to show the particular ids under the respective priority numbers. Any suggestions, please?
You can change or defined the column header labels at property Options.
$scope.options = {
...
treeTableColumns: ['from', 'to', 'myColumn'],
columnsHeaders: { 'model.name': 'Name', 'from': 'From', 'to': 'To', 'myColumn': 'My column name' },
columnsClasses: { //css
'myColumn': 'myclass'
},
//defined content here. ex: String, checkbox, radio, ...
//ex: <input type="checkbox" id={{row.model.id}} ng-model="row.model.myColumn">
columnsContents: {
'myColumn': '{{row.model.myColumn}}',
...
},
};
$scope.myData = [{
id: 1,
name: 'Finalize concept',
myColumn: 'content',
tasks: [{
id: 'Finalize concept',
name: 'Finalize concept',
priority: 10,
color: '#F1C232',
from: new Date(2013, 9, 17, 8, 0, 0),
to: new Date(2013, 9, 18, 18, 0, 0),
progress: 100
}]
}, {
id: 2,
name: 'Development',
myColumn: 'content',
children: ['Sprint 1', 'Sprint 2', 'Sprint 3', 'Sprint 4'],
content: '<i class="fa fa-file-code-o" ng-click="scope.handleRowIconClick(row.model)"></i> {{row.model.name}}'
} ]
https://www.angular-gantt.com/configuration/attributes/
Here yo have the answer about all you can do.
You cant change the column header labels but you can select between all the formats that you have:
$scope.headersFormats = {
'year': 'YYYY',
'quarter': '[Q]Q YYYY',
month: 'MMMM YYYY',
week: 'w',
day: 'D',
hour: 'H',
minute:'HH:mm'
};
Related
I have a react material-ui DataGrid.
One of the cells shows text data representing status, which I want to show in a graphical way - specifically bootstrap badge.
The DataGrid code is:
const ProcessesColumns: ColDef[] = [
{ field: 'id', headerName: 'ID' },
{ field: 'name', headerName: 'Name', width: 300 },
{ field: 'status', headerName: 'Status', width: 130 },
];
const processes = [
{
id: 1,
name: 'aaa',
status: 'Sucess',
},
{
id: 2,
name: 'bbb',
status: 'Fail',
},
{
id: 3,
name: 'ccc',
status: 'Sucess',
},
{
id: 4,
name: 'ddd',
status: 'Success',
},
{
id: 5,
name: 'eee',
status: 'Sucess',
},
{
id: 6,
name: 'fff',
status: 'Fail',
},
]
<DataGrid rows={processes} columns={ProcessesColumns} pageSize={10} />
I think you should check this
You can add a renderCell attribute on your status column definition
I think you can do it with renderCell. Here's an example of something similar, and I hope it helps.
I have a column which cells I want to format to have an icon and a value, and I created that in a format function:
const priorityFormater = (cell) => {
return (
<span>
<GrStatusGoodSmall className={taskPriorityColor(cell)} />
<span className="priority-span">{cell}</span>
</span>
);
};
Column definition:
{
field: "priority",
headerName: "Priority",
flex: 0,
minWidth: 140,
renderCell: (params) => {
return priorityFormater(params.value);
},
},
Result:
I have an example taken from highcharts: this question is very similar to Highcharts: legend of stacked chart
however I havent found the answer I'm looking there.
what I'm looking is something is to group the stack legends like shown below for every name legend it belongs.
in my case I want to have following structure in the legend
Male:
Joe
JOhn
Female:
Janet
Jane
is that possible?
I also tried : http://jsfiddle.net/7sgdbezh/
however since I'd be having multiple legends I dont want to clutter the chart with too many redundant stack name values.
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Total fruit consumtion, grouped by gender'
},
xAxis: {
categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
},
yAxis: {
allowDecimals: false,
min: 0,
title: {
text: 'Number of fruits'
}
},
tooltip: {
formatter: function() {
return '<b>'+ this.x +'</b><br/>'+
this.series.name +': '+ this.y +'<br/>'+
'Total: '+ this.point.stackTotal;
}
},
plotOptions: {
column: {
stacking: 'normal'
}
},
series: [{
name: 'John',
data: [5, 3, 4, 7, 2],
stack: 'male'
}, {
name: 'Joe',
data: [3, 4, 4, 2, 5],
stack: 'male'
}, {
name: 'Jane',
data: [2, 5, 6, 2, 1],
stack: 'female'
}, {
name: 'Janet',
data: [3, 0, 4, 4, 3],
stack: 'female'
}]
});
});
i have 2 select boxes,which is getting the data using ng-options and hardcoded.
the second select box should show the data based on the selected data in first selectbox. this is the plunker.
https://plnkr.co/edit/r1S1e61H3RfH3uYGYTBP?p=preview
can anyone please help me.
$scope.data = [{
cities: [{
id: 1,
title: 'Mysore'
}, {
id: 2,
title: 'Bangalore'
}, {
id: 3,
title: 'Delhi'
}, {
id: 4,
title: 'Mumbai'
}],
maps: [{
id: 1,
title: 'Zoo',
city_id: 1
}, {
id: 2,
title: 'Palace',
city_id: 1
}, {
id: 3,
title: 'Beach',
city_id: 4
}]
}];
You can pass the selected city's id from 1st drop down as a filter to 2nd drop down like below
<select name="mapSelect" required="true" ng-options="map as map.title for map in data[0].maps | filter:{'city_id':citySelect.selectedOption.id}" ng-model="mapSelect.selectedOption"></select>
I spent days trying to solve this one:
I'm trying to create a chart with several series. In one series I show a line with all points (in my code "val" series). In the second series I wish to show only part of the points ("temperature" series). Both series are showing a data type of int.
I tried to set a very low value to the "temperature" field in order to omit it from the chart but it also caused the respective "val" to be skipped!
In ExtJs 4.1.1: The 10am value of the "val" field is skipped.
In ExtJs 4.0.7: The 10am value of the "val" field exists!
(I wish I could post images here but I do not have 10 reputation points.:-( )
Here is my code:
Ext.define('WeatherPoint', {
extend: 'Ext.data.Model',
fields: ['temperature', 'date', 'val']
});
var store1 = Ext.create('Ext.data.Store', {
model: 'WeatherPoint',
data: [
{ temperature: 58, date: new Date(2011, 1, 1, 8), val: 10 },
{ temperature: 63, date: new Date(2011, 1, 1, 9), val: 20 },
{ temperature: -100, date: new Date(2011, 1, 1, 10), val: 40 },
{ temperature: 78, date: new Date(2011, 1, 1, 11), val: 90 },
{ temperature: 81, date: new Date(2011, 1, 1, 12), val: 50 }
]
});
var chart1 = Ext.create('Ext.chart.Chart',{
xtype: 'chart',
animate: false,
store: store1,
legend: true,
insetPadding: 30,
axes: [{
title: 'Temperature',
type: 'Numeric',
position: 'left',
fields: ['temperature', 'val'],
minimum: 0,
maximum: 100
}, {
title: 'Time',
type: 'Time',
position: 'bottom',
fields: ['date'],
dateFormat: 'ga',
step: [Ext.Date.HOUR, 1],
fromDate: new Date(2011, 1, 1, 8),
toDate: new Date(2011, 1, 1, 12)
}],
series: [{
type: 'scatter',
axis: ['left','bottom'],
xField: 'date',
yField: 'temperature'
}, {
type: 'line',
title: 'val',
axis: ['left','bottom'],
xField: 'date',
yField: 'val'
}]
});
var panel1 = Ext.create('widget.panel', {
width: 600,
height: 400,
renderTo: Ext.getBody(),
layout: 'fit',
items: chart1
});
Why 4.1.1 makes all series skip because of a value that is out-of-range in one series?
How can I show only part of the points in one series and all of the point in the second?
Try using null or empty '' values for points you want to hide.
Example:
var store1 = Ext.create('Ext.data.Store', {
model: 'WeatherPoint',
data: [
{ temperature: 58, date: new Date(2011, 1, 1, 8), val: 10 },
{ temperature: 63, date: new Date(2011, 1, 1, 9), val: 20 },
{ temperature: '', date: new Date(2011, 1, 1, 10), val: 40 },
{ temperature: 78, date: new Date(2011, 1, 1, 11), val: ''},
{ temperature: 81, date: new Date(2011, 1, 1, 12), val: 50 }
]
});
I'm trying to add Ext4 charting to an existing Ext3 application, using ext-all-sandbox.js. I've got the basics working, but the code below gives axis.processView is not a function. It works fine without the axes defined (but with no axes obviously).
It appears that the config objects are being used directly instead of being used to create actual axis instances. Any solutions to get this working?
TestGraphPanel = Ext.extend(Ext.Panel, {
initComponent: function() {
TestGraphPanel.superclass.initComponent.call(this);
Ext4.define('DataPoint', {
extend: 'Ext.data.Model',
fields: ['xValue', 'yValue']
});
this.store = Ext4.create('Ext.data.Store', {
model: 'DataPoint',
data: [
{xValue: 0, yValue: 2},
{xValue: 1, yValue: 4},
{xValue: 2, yValue: 7},
{xValue: 3, yValue: 5},
{xValue: 4, yValue: 8},
{xValue: 5, yValue: 9}
]
});
},
afterRender: function() {
Ext4.create('Ext.chart.Chart', {
renderTo: this.body.dom,
width: this.ownerCt.getWidth(),
height: this.ownerCt.getHeight(),
store: this.store,
axes: [
{
title: 'x',
type: 'Numeric',
postition: 'bottom',
fields: ['xValue']
},
{
title: 'y',
type: 'Numeric',
position: 'left',
fields: ['yValue']
}
],
series: [
{
type: 'line',
xField: 'xValue',
yField: 'yValue'
}
]
});
}
});
After a quick look at the source, I think your problem might come from the fact that you're creating your chart in the afterRender.
I'm thinking of those lines in particular
//process all views (aggregated data etc) on stores
//before rendering.
me.axes.each(function(axis) {
axis.processView();
});
The config objects are parsed just before. Otherwise try to set a breakpoint in there and check the objects.