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

✨ [Feature]: 请问Chart 图表 柱状图和折线图合在一起咋整 #1703

Open
qq286674943 opened this issue Jun 28, 2024 · 5 comments

Comments

@qq286674943
Copy link

What problem does this feature solve

Chart 图表 柱状图和折线图合在一起咋整

What does the proposed API look like

类似这种
8570a9613409e497566efea9a0d5ddb

What is your project name

tiny-vue

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: ✨ [Feature]: How to combine Chart chart, bar chart and line chart?

@qq286674943
Copy link
Author

qq286674943 commented Jun 28, 2024 via email

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


This is the holiday automatic reply email from QQ mailbox. Hello, I am currently on vacation and cannot reply to your email personally. I will reply to you as soon as possible after the holiday.

@Davont
Copy link
Member

Davont commented Jun 28, 2024

折柱混合我们这边有lineDataName属性,你可以将你想要变为折线的数据放入对应的数组中,下面是示例代码,

<template>
  <div>
    <tiny-histogram :options="options"></tiny-histogram>
  </div>
</template>

<script lang="jsx">
import { ChartHistogram } from '@opentiny/vue'

export default {
  components: {
    TinyHistogram: ChartHistogram
  },
  data() {
    return {
      options: {
        data: [
          { 'Month': 'Jan', 'Domestic': 33, 'Abroad': 1 },
          { 'Month': 'Feb', 'Domestic': 27, 'Abroad': 39 },
          { 'Month': 'Mar', 'Domestic': 31, 'Abroad': 20 },
          { 'Month': 'Apr', 'Domestic': 30, 'Abroad': 15 },
          { 'Month': 'May', 'Domestic': 37, 'Abroad': 1 },
          { 'Month': 'Jun', 'Domestic': 36, 'Abroad': 17 },
          { 'Month': 'Jul', 'Domestic': 42, 'Abroad': 22 },
          { 'Month': 'Aug', 'Domestic': 22, 'Abroad': 12 },
          { 'Month': 'Sep', 'Domestic': 17, 'Abroad': 30 },
          { 'Month': 'Oct', 'Domestic': 40, 'Abroad': 33 },
          { 'Month': 'Nov', 'Domestic': 42, 'Abroad': 22 },
          { 'Month': 'Dec', 'Domestic': 32, 'Abroad': 1 }
        ],
        lineDataName: ['Domestic'],
        xAxis: 'Month',
        yAxis: {
          name: 'Percent(%)'
        }
      }
    }
  }
}
</script>

折柱混合我这边之后会在案例中添加上去

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


For polyline mixing, we have the lineDataName property here. You can put the data you want to turn into a polyline into the corresponding array. The following is a sample code.

<template>
  <div>
    <tiny-histogram :options="options"></tiny-histogram>
  </div>
</template>

<script lang="jsx">
import { ChartHistogram } from '@opentiny/vue'

export default {
  components: {
    TinyHistogram: ChartHistogram
  },
  data() {
    return {
      options: {
        data: [
          { 'Month': 'Jan', 'Domestic': 33, 'Abroad': 1 },
          { 'Month': 'Feb', 'Domestic': 27, 'Abroad': 39 },
          { 'Month': 'Mar', 'Domestic': 31, 'Abroad': 20 },
          { 'Month': 'Apr', 'Domestic': 30, 'Abroad': 15 },
          { 'Month': 'May', 'Domestic': 37, 'Abroad': 1 },
          { 'Month': 'Jun', 'Domestic': 36, 'Abroad': 17 },
          { 'Month': 'Jul', 'Domestic': 42, 'Abroad': 22 },
          { 'Month': 'Aug', 'Domestic': 22, 'Abroad': 12 },
          { 'Month': 'Sep', 'Domestic': 17, 'Abroad': 30 },
          { 'Month': 'Oct', 'Domestic': 40, 'Abroad': 33 },
          { 'Month': 'Nov', 'Domestic': 42, 'Abroad': 22 },
          { 'Month': 'Dec', 'Domestic': 32, 'Abroad': 1 }
        ],
        lineDataName: ['Domestic'],
        xAxis: 'Month',
        yAxis: {
          name: 'Percent(%)'
        }
      }
    }
  }
}
</script>

After I mix the folding column, I will add it to the case.

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

3 participants