Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(chat): align line chart dates with responsive point labels

Chrisd539d7cabc83
diff --git a/apps/desktop/src/renderer/components/chat/RichAnswer.tsx b/apps/desktop/src/renderer/components/chat/RichAnswer.tsx
index 71326083b2..ce9627e1fa 100644
--- a/apps/desktop/src/renderer/components/chat/RichAnswer.tsx
+++ b/apps/desktop/src/renderer/components/chat/RichAnswer.tsx
@@ -453,8 +453,8 @@ function AnswerLineChart({
))}
</svg>
<dl
- className={data.length <= 8 ? 'rich-answer-chart-labels' : undefined}
- style={data.length <= 8 ? { paddingLeft: plot.left, paddingRight: plot.right } : undefined}
+ className={plot.showValues ? 'rich-answer-chart-labels' : undefined}
+ style={plot.showValues ? { paddingLeft: plot.left, paddingRight: plot.right } : undefined}
>
{data.map((item, i) => (
<div key={i}>
diff --git a/apps/mobile/src/session/RichAnswer.tsx b/apps/mobile/src/session/RichAnswer.tsx
index 3437d0afee..58773b4a63 100644
--- a/apps/mobile/src/session/RichAnswer.tsx
+++ b/apps/mobile/src/session/RichAnswer.tsx
@@ -495,8 +495,8 @@ function AnswerLineChart({
</Svg>
<View
style={[
- data.length <= 8 ? styles.chartLabels : styles.stack,
- data.length <= 8 && {
+ plot.showValues ? styles.chartLabels : styles.stack,
+ plot.showValues && {
paddingLeft: plot.left,
paddingRight: plot.right,
},
@@ -505,12 +505,12 @@ function AnswerLineChart({
{data.map((item, i) => (
<View
key={i}
- style={data.length <= 8 ? styles.chartLabel : styles.labelRow}
+ style={plot.showValues ? styles.chartLabel : styles.labelRow}
>
<Text
style={[
styles.caption,
- data.length <= 8 && styles.chartLabelText,
+ plot.showValues && styles.chartLabelText,
]}
>
{item.label}
diff --git a/docs/images/rich-answers/chart-axis-alignment.png b/docs/images/rich-answers/chart-axis-alignment.png
new file mode 100644
index 0000000000..8daedbe326
Binary files /dev/null and b/docs/images/rich-answers/chart-axis-alignment.png differ