Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pydatview/plotdata.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import numpy as np
import pandas
from pydatview.common import no_unit, unit, inverse_unit, splitunit, has_chinese_char
from pydatview.common import isString, isDate, getDt
from pydatview.common import unique, pretty_num, pretty_time, pretty_date
Expand Down Expand Up @@ -118,12 +119,12 @@ def _post_init(PD, pipeline=None):


# --- Store stats
n=len(PD.y)
if n>1000:
n=len(pandas.unique(PD.y))
if n>100:
if (PD.xIsString):
raise Exception('Error: x values contain more than 1000 string. This is not suitable for plotting.\n\nPlease select another column for table: {}\nProblematic column: {}\n'.format(PD.st,PD.sx))
raise Exception('Error: x values contain more than 100 unique string. This is not suitable for plotting.\n\nPlease select another column for table: {}\nProblematic column: {}\n'.format(PD.st,PD.sx))
if (PD.yIsString):
raise Exception('Error: y values contain more than 1000 string. This is not suitable for plotting.\n\nPlease select another column for table: {}\nProblematic column: {}\n'.format(PD.st,PD.sy))
raise Exception('Error: y values contain more than 100 unique string. This is not suitable for plotting.\n\nPlease select another column for table: {}\nProblematic column: {}\n'.format(PD.st,PD.sy))

PD.needChineseFont = has_chinese_char(PD.sy) or has_chinese_char(PD.sx)
# Stats of the raw data (computed once and for all, since it can be expensive for large dataset
Expand Down