円グラフ (Pie Chart) - 構成比などを表現 if any(w in prompt for w in ["円", "割合", "比率", "構成"]): fig = px.pie( result_df, names=result_df.columns[0], values=result_df.columns[1], # 統一カラーパレットを適用 color_discrete_sequence=['#4361ee', '#3a0ca3'] ) # 2. 折れ線グラフ (Line Chart) - 時系列変化 elif any(w in prompt for w in ["推移", "変化", "トレンド", "線"]): fig = px.line( result_df, x=result_df.columns[0], y=result_df.columns[1], color_discrete_sequence=['#4361ee'] ) # 3. 散布図 (Scatter Plot) - 相関関係 elif any(w in prompt for w in ["関係", "相関", "散布"]): fig = px.scatter(result_df, ...) # 4. デフォルト: 棒グラフ (Bar Chart) else: fig = px.bar( result_df, x=result_df.columns[0], y=result_df.columns[1], color_discrete_sequence=['#4361ee'] ) Pie Chart px.pie() 割合 比率 構成 内訳 Line Chart px.line() 推移 変化 トレンド 時系列 Scatter Plot px.scatter() 関係 相関 分布 Bar Chart (Default) px.bar() No keyword match