Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wont work with large number of series #78

Closed
noctivityinc opened this issue Sep 25, 2012 · 3 comments
Closed

Wont work with large number of series #78

noctivityinc opened this issue Sep 25, 2012 · 3 comments

Comments

@noctivityinc
Copy link

No idea but when trying to chart 50 series, it fails:

Morris.Line({
                            element: 'fpt_chart',
                            data: [{"NY":0.0,"AL":0.0909090909090909,"VA":0.0416666666666667,"ND":0.0,"RI":0.0,"MD":0.0,"DE":0.5,"CO":0.266666666666667,"HI":0.0,"MN":0.0,"NE":0.0,"WY":0.5,"MO":1.42857142857143,"IA":0.0,"ME":0.0,"OH":0.0,"OR":0.166666666666667,"IL":0.0303030303030303,"AZ":0.142857142857143,"created_date":"2012-07-28","KY":0.0,"GA":0.0,"TN":0.222222222222222,"NH":0.166666666666667,"TX":0.0408163265306122,"ID":0.0,"IN":0.393939393939394,"SC":0.0,"SD":0.0,"MS":0.0,"MI":0.0,"CT":0.0392156862745098,"FL":0.0163934426229508,"NJ":0.0533333333333333,"PA":0.0869565217391304,"AR":0.0,"OK":0.0,"WI":0.0,"MT":0.0,"US":0.0,"KS":0.0,"CA":0.120879120879121,"NV":0.192307692307692,"VT":0.0,"UT":0.142857142857143,"NM":0.222222222222222,"DC":0.133333333333333,"MA":0.0,"WV":0.0,"WA":0.0,"LA":0.0,"AK":0.0,"NC":0.05},{"VA":0.0,"ND":0.0,"AL":0.0,"NY":0.0135135135135135,"HI":0.0,"DE":0.0,"CO":0.0,"MD":0.142857142857143,"MN":0.09375,"NE":0.0,"RI":0.0,"WY":0.0,"IA":0.0,"ME":0.0,"MO":0.0,"KY":0.333333333333333,"AZ":0.0689655172413793,"IL":0.135135135135135,"OR":0.108108108108108,"created_date":"2012-07-29","OH":0.0,"TN":0.0,"NH":0.0416666666666667,"TX":0.129032258064516,"GA":0.0,"SC":0.0,"IN":0.0,"ID":0.0,"OK":0.0,"MS":0.0,"PA":0.0344827586206897,"MI":0.0526315789473684,"FL":0.0476190476190476,"AR":0.0357142857142857,"NJ":0.010989010989011,"CT":0.0,"SD":0.0,"MT":0.5,"WI":0.0,"NV":0.0,"US":0.0,"KS":0.0,"CA":0.159362549800797,"VT":0.0,"WV":0.0,"UT":0.0666666666666667,"MA":0.263157894736842,"DC":0.25,"NM":0.0,"LA":0.0461538461538462,"NC":0.0458715596330275,"AK":0.0,"WA":0.0},{"NY":0.0224719101123595,"AL":0.0714285714285714,"VA":0.037037037037037,"ND":0.0,"RI":0.230769230769231,"MN":0.0133333333333333,"HI":0.130434782608696,"DE":0.1,"CO":0.0294117647058824,"MD":0.0,"NE":0.0,"WY":0.0,"MO":0.0,"ME":0.0,"IA":0.125,"OH":0.0,"created_date":"2012-07-30","OR":0.14,"KY":0.133333333333333,"IL":0.0410958904109589,"AZ":0.0,"TX":0.037037037037037,"NH":0.0714285714285714,"TN":0.05,"GA":0.0,"ID":0.0,"IN":0.0285714285714286,"SC":0.0,"SD":0.0,"AR":0.0,"CT":0.0384615384615385,"FL":0.0247933884297521,"MI":0.0277777777777778,"MS":0.25,"OK":0.105263157894737,"PA":0.0357142857142857,"NJ":0.0,"WI":0.0555555555555556,"MT":0.0,"VT":0.0,"NV":0.0,"US":0.0,"CA":0.099009900990099,"KS":0.0,"NM":0.0,"MA":0.0833333333333333,"DC":0.0588235294117647,"UT":0.0,"WV":0.0,"WA":0.0357142857142857,"NC":0.0829015544041451,"AK":0.4,"LA":0.0106382978723404},{"ND":0.0,"NY":0.021505376344086,"AL":0.12,"VA":0.0567375886524823,"NE":0.235294117647059,"MN":0.0508474576271186,"CO":0.0256410256410256,"HI":0.0625,"DE":0.0,"MD":0.0,"RI":0.0,"WY":0.0,"MO":0.0,"ME":0.0,"IA":0.578947368421053,"OR":0.0111111111111111,"IL":0.0246913580246914,"AZ":0.0158730158730159,"OH":0.0263157894736842,"created_date":"2012-07-31","KY":0.0,"TX":0.036036036036036,"GA":0.04,"TN":0.333333333333333,"NH":0.0,"SC":0.0,"ID":0.136363636363636,"IN":0.010752688172043,"PA":0.0,"MI":0.0,"AR":0.0425531914893617,"CT":0.0121951219512195,"FL":0.0241935483870968,"NJ":0.103174603174603,"MS":0.0,"OK":0.0,"SD":0.0,"MT":0.0,"WI":0.0,"US":0.0,"KS":0.0,"CA":0.0401146131805158,"NV":0.303030303030303,"VT":0.0,"UT":0.0,"WV":0.12,"NM":0.529411764705882,"DC":0.476190476190476,"MA":0.05,"WA":0.0,"AK":0.0,"LA":0.166666666666667,"NC":0.0258064516129032},{"NY":0.0,"VA":0.0479452054794521,"AL":0.0,"ND":0.0,"MN":0.072463768115942,"DE":0.5,"CO":0.03125,"HI":0.0,"MD":0.0,"NE":0.0,"RI":0.0,"WY":0.0,"MO":0.0,"ME":0.0,"IA":0.0,"created_date":"2012-08-01","KY":0.0769230769230769,"IL":0.338461538461538,"AZ":0.0166666666666667,"OH":0.0571428571428571,"OR":0.0392156862745098,"TN":0.0,"TX":0.0204081632653061,"GA":0.087719298245614,"NH":0.103448275862069,"SC":0.0,"IN":0.0,"ID":0.05,"PA":0.0,"NJ":0.0,"OK":0.125,"CT":0.0740740740740741,"AR":0.0384615384615385,"FL":0.00735294117647059,"MI":0.0857142857142857,"MS":0.3,"SD":0.0,"MT":0.0,"WI":0.0,"VT":0.0,"US":0.0,"NV":0.227272727272727,"CA":0.0557184750733138,"KS":0.176470588235294,"WV":0.0,"MA":0.111111111111111,"DC":0.05,"NM":0.0,"UT":0.0,"AK":0.0,"NC":0.0327868852459016,"LA":0.171875,"WA":0.0},{"AL":0.0,"VA":0.0303030303030303,"ND":0.4,"NY":0.0495049504950495,"MN":0.0857142857142857,"CO":0.173913043478261,"MD":0.0344827586206897,"NE":0.166666666666667,"DE":0.0,"HI":0.0,"RI":0.0,"MO":0.0,"IA":0.0,"WY":0.166666666666667,"ME":0.0,"OH":0.0,"KY":0.0,"OR":0.0377358490566038,"AZ":0.0789473684210526,"IL":0.0476190476190476,"created_date":"2012-08-02","TX":0.127906976744186,"NH":0.241379310344828,"GA":0.25,"TN":0.428571428571429,"SC":0.0,"IN":0.109375,"ID":0.0666666666666667,"PA":0.0,"MI":0.0,"AR":0.0,"FL":0.0656934306569343,"CT":0.0952380952380952,"NJ":0.0303030303030303,"MS":0.0,"OK":0.0,"SD":0.0,"WI":0.0,"MT":0.0,"VT":0.0,"US":0.0,"NV":0.1,"CA":0.0991501416430595,"KS":0.0,"DC":0.0,"MA":0.291666666666667,"UT":0.0625,"NM":0.0,"WV":0.0,"LA":0.115384615384615,"NC":0.101796407185629,"WA":0.375,"AK":0.0},{"ND":0.0,"AL":0.0833333333333333,"VA":0.0441176470588235,"NY":0.0,"RI":0.0,"HI":0.0,"MD":0.0625,"CO":0.0666666666666667,"MN":0.0333333333333333,"DE":0.0,"NE":0.0,"WY":0.0,"ME":0.0,"IA":0.0,"MO":0.0,"KY":0.0,"IL":0.0,"OR":0.0208333333333333,"OH":0.0476190476190476,"created_date":"2012-08-03","AZ":0.0,"TN":0.0,"NH":0.0,"GA":0.148148148148148,"TX":0.0208333333333333,"SC":0.0625,"IN":0.470588235294118,"ID":0.0,"MS":0.0,"CT":0.0,"AR":0.125,"FL":0.0405405405405405,"PA":0.05,"MI":0.0,"NJ":0.0,"OK":0.0,"SD":0.0,"WI":0.526315789473684,"MT":1.0,"US":0.0,"NV":0.125,"KS":0.0454545454545455,"CA":0.121739130434783,"VT":0.0,"NM":0.0,"UT":0.05,"DC":0.444444444444444,"MA":0.363636363636364,"WV":0.0,"WA":0.0,"AK":0.0,"NC":0.0277777777777778,"LA":0.0},{"VA":0.0,"ND":0.0,"NY":0.0,"AL":0.0,"MN":0.0,"CO":0.0,"DE":0.0,"HI":0.0,"MD":0.0,"NE":0.0,"RI":0.0,"WY":0.0,"MO":0.0,"ME":2.0,"IA":0.0,"AZ":0.0,"created_date":"2012-08-07","IL":0.0,"KY":0.0,"OH":0.0,"OR":0.0,"TN":0.0,"GA":0.0,"NH":0.0,"TX":0.0,"SC":0.0,"IN":0.0,"ID":0.0,"PA":0.0,"OK":0.0,"NJ":0.0,"CT":0.0,"AR":0.0,"FL":0.0,"MI":0.0,"MS":0.0,"SD":0.0,"MT":0.0,"WI":0.0,"NV":0.0,"US":0.0,"KS":0.0,"CA":0.0,"VT":0.0,"WV":0.0,"UT":0.0,"MA":0.0,"DC":0.0,"NM":0.0,"LA":0.0,"AK":0.0,"NC":0.0,"WA":0.0},{"VA":0.0,"AL":0.0,"NY":0.0,"ND":0.0,"NE":0.0,"MD":0.0,"CO":0.0,"DE":0.0,"HI":0.0,"MN":0.0,"RI":0.0,"WY":0.0,"IA":0.0,"ME":0.0,"MO":0.0,"OH":0.0,"created_date":"2012-08-09","OR":2.0,"AZ":0.0,"IL":0.0,"KY":0.0,"TN":0.0,"NH":0.0,"GA":0.0,"TX":0.0,"SC":0.0,"IN":0.0,"ID":0.0,"PA":0.0,"MS":0.0,"MI":0.0,"CT":0.0,"AR":2.0,"FL":0.0,"NJ":0.0,"OK":0.0,"SD":0.0,"MT":0.0,"WI":0.0,"KS":0.0,"CA":0.0,"US":0.0,"NV":0.0,"VT":0.0,"WV":0.0,"UT":0.0,"NM":0.0,"DC":0.0,"MA":0.0,"NC":0.0,"LA":0.0,"AK":0.0,"WA":0.0}],
                            xkey: 'created_date',
                            ykeys: ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "US", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"],
                            labels: ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "US", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"]
                          })
@oesmith
Copy link
Contributor

oesmith commented Sep 25, 2012

Try adding lineColors to your config with enough colors for all of your series (I think the default config only supports a maximum of 8ish series before it runs out of colors).

@noctivityinc
Copy link
Author

That would do it, but there should probably be SOME form of error checking or messaging to inform the developer that the maximum number of series has been hit.

oesmith added a commit that referenced this issue Sep 25, 2012
Fixes crashes when number of series is larger than number of line colors.
@oesmith
Copy link
Contributor

oesmith commented Sep 25, 2012

That last commit removes the lineColors.length >= ykeys.length requirement. It'll cycle color values when they run out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants