Skip to content

Commit

Permalink
Merge pull request getredash#6 from salabh-aot/gannt2
Browse files Browse the repository at this point in the history
gantt chart updates
  • Loading branch information
dinesh-aot authored Mar 23, 2022
2 parents 840def6 + 6d249cc commit 1a3cba2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
26 changes: 8 additions & 18 deletions viz-lib/src/visualizations/gantt-chart/Renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ highchartsGantt(Highcharts);
import "./renderer.less";

function prepareData(data: any) {
const colors: any = {
"Early Engagement": "#e1ebf3",
"Proponent Time: Project Description": "#ccffff",
"Readiness Decision": "#c3d7e8",
"Process Planning": "#a6c3dd",
"Proponent Time: Application Development": "#ccffff",
"Application Development & Review": "#faeadc",
"Proponent Time: Revised Application": "#ccffff",
"Effects Assessment": "#f6d5b9",
Recommendation: "#f2c096",
"Referral/Decision": "#f2c096",
};
const projects = groupBy(data, (item: any) => item.project);
const series: Array<any> = [];
let projectIndex = 0;
Expand All @@ -44,7 +32,7 @@ function prepareData(data: any) {
start: new Date(phase.phase_start).getTime(),
end: new Date(phase.phase_end).getTime(),
y: projectIndex,
color: colors[phase.phase],
color: phase.color,
});
});
series.push(projectSeries);
Expand All @@ -65,20 +53,22 @@ export default function Renderer({ data, options }: any) {
},
xAxis: [
{
tickInterval: 1000 * 60 * 60 * 24 * 30, // Month
tickInterval: day * 30, // Month

labels: {
format: "{value:%b}",
style: {
fontSize: "8px",
fontSize: "10px",
width: 150,
padding: "5px",
},
autoRotation: [-90],
},
min: first.data[0].start - day * 15,
max: last.data[last.data.length - 1].end + day * 15,
currentDateIndicator: false,
currentDateIndicator: true,
},
{
tickInterval: 1000 * 60 * 60 * 24 * 365, // Year
tickInterval: day * 365, // Year
labels: {
format: "{value:%Y}",
},
Expand Down
3 changes: 1 addition & 2 deletions viz-lib/src/visualizations/gantt-chart/renderer.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
-webkit-overflow-scrolling: touch;

.gantt-chart-visualization {
min-width: 800px;
min-width: 1200px;
min-width: 2200px;
margin: 1em auto;
overflow-x: auto !important;
}
Expand Down

0 comments on commit 1a3cba2

Please sign in to comment.