@@ -621,15 +621,15 @@ def create_gantt(df, colors=None, index_col=None, show_colorbar=False,
621
621
Example 1: Simple Gantt Chart
622
622
```
623
623
import plotly.plotly as py
624
- from plotly.tools import FigureFactory as FF
624
+ from plotly.figure_factory import create_gantt
625
625
626
626
# Make data for chart
627
627
df = [dict(Task="Job A", Start='2009-01-01', Finish='2009-02-30'),
628
628
dict(Task="Job B", Start='2009-03-05', Finish='2009-04-15'),
629
629
dict(Task="Job C", Start='2009-02-20', Finish='2009-05-30')]
630
630
631
631
# Create a figure
632
- fig = FF. create_gantt(df)
632
+ fig = create_gantt(df)
633
633
634
634
# Plot the data
635
635
py.iplot(fig, filename='Simple Gantt Chart', world_readable=True)
@@ -638,7 +638,7 @@ def create_gantt(df, colors=None, index_col=None, show_colorbar=False,
638
638
Example 2: Index by Column with Numerical Entries
639
639
```
640
640
import plotly.plotly as py
641
- from plotly.tools import FigureFactory as FF
641
+ from plotly.figure_factory import create_gantt
642
642
643
643
# Make data for chart
644
644
df = [dict(Task="Job A", Start='2009-01-01',
@@ -649,9 +649,9 @@ def create_gantt(df, colors=None, index_col=None, show_colorbar=False,
649
649
Finish='2009-05-30', Complete=95)]
650
650
651
651
# Create a figure with Plotly colorscale
652
- fig = FF. create_gantt(df, colors='Blues', index_col='Complete',
653
- show_colorbar=True, bar_width=0.5,
654
- showgrid_x=True, showgrid_y=True)
652
+ fig = create_gantt(df, colors='Blues', index_col='Complete',
653
+ show_colorbar=True, bar_width=0.5,
654
+ showgrid_x=True, showgrid_y=True)
655
655
656
656
# Plot the data
657
657
py.iplot(fig, filename='Numerical Entries', world_readable=True)
@@ -660,7 +660,7 @@ def create_gantt(df, colors=None, index_col=None, show_colorbar=False,
660
660
Example 3: Index by Column with String Entries
661
661
```
662
662
import plotly.plotly as py
663
- from plotly.tools import FigureFactory as FF
663
+ from plotly.figure_factory import create_gantt
664
664
665
665
# Make data for chart
666
666
df = [dict(Task="Job A", Start='2009-01-01',
@@ -671,12 +671,9 @@ def create_gantt(df, colors=None, index_col=None, show_colorbar=False,
671
671
Finish='2009-05-30', Resource='Banana')]
672
672
673
673
# Create a figure with Plotly colorscale
674
- fig = FF.create_gantt(df, colors=['rgb(200, 50, 25)',
675
- (1, 0, 1),
676
- '#6c4774'],
677
- index_col='Resource',
678
- reverse_colors=True,
679
- show_colorbar=True)
674
+ fig = create_gantt(df, colors=['rgb(200, 50, 25)', (1, 0, 1), '#6c4774'],
675
+ index_col='Resource', reverse_colors=True,
676
+ show_colorbar=True)
680
677
681
678
# Plot the data
682
679
py.iplot(fig, filename='String Entries', world_readable=True)
@@ -685,7 +682,7 @@ def create_gantt(df, colors=None, index_col=None, show_colorbar=False,
685
682
Example 4: Use a dictionary for colors
686
683
```
687
684
import plotly.plotly as py
688
- from plotly.tools import FigureFactory as FF
685
+ from plotly.figure_factory import create_gantt
689
686
690
687
# Make data for chart
691
688
df = [dict(Task="Job A", Start='2009-01-01',
@@ -701,9 +698,8 @@ def create_gantt(df, colors=None, index_col=None, show_colorbar=False,
701
698
'Banana': (1, 1, 0.2)}
702
699
703
700
# Create a figure with Plotly colorscale
704
- fig = FF.create_gantt(df, colors=colors,
705
- index_col='Resource',
706
- show_colorbar=True)
701
+ fig = create_gantt(df, colors=colors, index_col='Resource',
702
+ show_colorbar=True)
707
703
708
704
# Plot the data
709
705
py.iplot(fig, filename='dictioanry colors', world_readable=True)
@@ -712,7 +708,7 @@ def create_gantt(df, colors=None, index_col=None, show_colorbar=False,
712
708
Example 5: Use a pandas dataframe
713
709
```
714
710
import plotly.plotly as py
715
- from plotly.tools import FigureFactory as FF
711
+ from plotly.figure_factory import create_gantt
716
712
717
713
import pandas as pd
718
714
@@ -723,9 +719,9 @@ def create_gantt(df, colors=None, index_col=None, show_colorbar=False,
723
719
columns=['Task', 'Start', 'Finish', 'Complete'])
724
720
725
721
# Create a figure with Plotly colorscale
726
- fig = FF. create_gantt(df, colors='Blues', index_col='Complete',
727
- show_colorbar=True, bar_width=0.5,
728
- showgrid_x=True, showgrid_y=True)
722
+ fig = create_gantt(df, colors='Blues', index_col='Complete',
723
+ show_colorbar=True, bar_width=0.5,
724
+ showgrid_x=True, showgrid_y=True)
729
725
730
726
# Plot the data
731
727
py.iplot(fig, filename='data with dataframe', world_readable=True)
0 commit comments