feat: replace charts with charts built on coreui-vue-chartjs library
This commit is contained in:
+2
-1
@@ -15,7 +15,8 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coreui/coreui": "^2.1.6",
|
"@coreui/coreui": "^2.1.6",
|
||||||
"@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.2.0",
|
"@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.3.0",
|
||||||
|
"@coreui/coreui-vue-chartjs": "file:../coreui-vue-chartjs",
|
||||||
"@coreui/icons": "0.3.0",
|
"@coreui/icons": "0.3.0",
|
||||||
"@coreui/vue": "../coreui-vue",
|
"@coreui/vue": "../coreui-vue",
|
||||||
"babel-polyfill": "^6.26.0",
|
"babel-polyfill": "^6.26.0",
|
||||||
|
|||||||
+12
-26
@@ -1,57 +1,43 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="animated fadeIn">
|
<div class="animated fadeIn">
|
||||||
<CCardGroup columns class="card-columns">
|
<CCardGroup columns class="card-columns cols-2">
|
||||||
<CCard headerHtml="Line Chart" bodyWrapper>
|
<CCard headerHtml="Line Chart" bodyWrapper>
|
||||||
<LineExample/>
|
<CChartLineExample/>
|
||||||
</CCard>
|
</CCard>
|
||||||
<CCard headerHtml="Bar Chart" bodyWrapper>
|
<CCard headerHtml="Bar Chart" bodyWrapper>
|
||||||
<BarExample/>
|
<CChartBarExample/>
|
||||||
</CCard>
|
</CCard>
|
||||||
<CCard headerHtml="Doughnut Chart" bodyWrapper>
|
<CCard headerHtml="Doughnut Chart" bodyWrapper>
|
||||||
<DoughnutExample/>
|
<CChartDoughnutExample/>
|
||||||
</CCard>
|
</CCard>
|
||||||
<CCard headerHtml="Radar Chart" bodyWrapper>
|
<CCard headerHtml="Radar Chart" bodyWrapper>
|
||||||
<RadarExample/>
|
<CChartRadarExample/>
|
||||||
</CCard>
|
</CCard>
|
||||||
<CCard headerHtml="Pie Chart" bodyWrapper>
|
<CCard headerHtml="Pie Chart" bodyWrapper>
|
||||||
<PieExample/>
|
<CChartPieExample/>
|
||||||
</CCard>
|
</CCard>
|
||||||
<CCard headerHtml="Polar Area Chart" bodyWrapper>
|
<CCard headerHtml="Polar Area Chart" bodyWrapper>
|
||||||
<PolarAreaExample/>
|
<CChartPolarAreaExample/>
|
||||||
</CCard>
|
</CCard>
|
||||||
<CCard headerHtml="Simple line chart" bodyWrapper>
|
<CCard headerHtml="Simple line chart" bodyWrapper>
|
||||||
<CSimpleLineChart style="height:80px" :data='[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]'
|
<CChartLineSimple borderColor="success" labels="months"/>
|
||||||
label='Sales' borderColor='success'/>
|
|
||||||
</CCard>
|
</CCard>
|
||||||
<CCard headerHtml="Simple pointed chart" bodyWrapper>
|
<CCard headerHtml="Simple pointed chart" bodyWrapper>
|
||||||
<CSimplePointedChart class='px-3' :data='[65, 59, 84, 84, 51, 55, 40]'
|
<CChartLineSimple pointed borderColor="warning"/>
|
||||||
:labels="['January', 'February', 'March', 'April', 'May', 'June', 'July']"
|
|
||||||
style='height:80px' label='Members' pointHoverColor='warning' borderColor='warning'/>
|
|
||||||
</CCard>
|
</CCard>
|
||||||
<CCard headerHtml="Simple bar chart" bodyWrapper>
|
<CCard headerHtml="Simple bar chart" bodyWrapper>
|
||||||
<CSimpleBarChart style="height:80px" :data='[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]'
|
<CChartBarSimple backgroundColor="danger"/>
|
||||||
label='Sales' color='danger'/>
|
|
||||||
</CCard>
|
</CCard>
|
||||||
</CCardGroup>
|
</CCardGroup>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import BarExample from './charts/BarExample'
|
import * as Charts from './charts/index.js'
|
||||||
import LineExample from './charts/LineExample'
|
|
||||||
import DoughnutExample from './charts/DoughnutExample'
|
|
||||||
import RadarExample from './charts/RadarExample'
|
|
||||||
import PieExample from './charts/PieExample'
|
|
||||||
import PolarAreaExample from './charts/PolarAreaExample'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Charts',
|
name: 'Charts',
|
||||||
components: {
|
components: {
|
||||||
BarExample,
|
...Charts
|
||||||
LineExample,
|
|
||||||
DoughnutExample,
|
|
||||||
RadarExample,
|
|
||||||
PieExample,
|
|
||||||
PolarAreaExample
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
+27
-16
@@ -23,7 +23,7 @@
|
|||||||
</CButtonGroup>
|
</CButtonGroup>
|
||||||
</CCol>
|
</CCol>
|
||||||
</CRow>
|
</CRow>
|
||||||
<MainChartExample style="height:300px;margin-top:40px;" height="300"></MainChartExample>
|
<MainChartExample style="height:300px;margin-top:40px;"/>
|
||||||
</CCardBody>
|
</CCardBody>
|
||||||
<CCardFooter>
|
<CCardFooter>
|
||||||
<CRow class="text-center">
|
<CRow class="text-center">
|
||||||
@@ -66,19 +66,29 @@
|
|||||||
<CCallout variant="info">
|
<CCallout variant="info">
|
||||||
<small class="text-muted">New Clients</small><br>
|
<small class="text-muted">New Clients</small><br>
|
||||||
<strong class="h4">9,123</strong>
|
<strong class="h4">9,123</strong>
|
||||||
<div :style="{ top: '-10px'}">
|
|
||||||
<!--<CalloutChartExample :data="[35, 23, 56, 22, 97, 23, 64]" variant="#20a8d8" width="80" height="30" />-->
|
|
||||||
<CalloutChartExample :data="[35, 23, 56, 22, 97, 23, 64]" variant="info" width="80" height="30" />
|
|
||||||
</div>
|
|
||||||
</CCallout>
|
</CCallout>
|
||||||
|
<!-- <CCallout variant="info" class="d-inline">
|
||||||
|
<div class="d-inline">
|
||||||
|
<small class="text-muted">New Clients</small><br>
|
||||||
|
<strong class="h4">9,123</strong>
|
||||||
|
</div>
|
||||||
|
<div class="d-inline">
|
||||||
|
<CChartLineSimple
|
||||||
|
:data="[35, 23, 56, 22, 97, 23, 64]"
|
||||||
|
borderColor="info"
|
||||||
|
style="width:80px !important"
|
||||||
|
:options="{ maintainAspectRatio: true, aspectRatio: 3 }"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</CCallout> -->
|
||||||
</CCol>
|
</CCol>
|
||||||
<CCol sm="6">
|
<CCol sm="6">
|
||||||
<CCallout variant="danger">
|
<CCallout variant="danger">
|
||||||
<small class="text-muted">Recurring Clients</small><br>
|
<small class="text-muted">Recurring Clients</small><br>
|
||||||
<strong class="h4">22,643</strong>
|
<strong class="h4">22,643</strong>
|
||||||
<div :style="{ top: '-10px'}">
|
<!-- <div :style="{ top: '-10px'}">
|
||||||
<CalloutChartExample :data="[65, 59, 84, 84, 51, 55, 40]" variant="danger" width="80" height="30" />
|
<CalloutChartExample :data="[65, 59, 84, 84, 51, 55, 40]" variant="danger" width="80" height="30" />
|
||||||
</div>
|
</div> -->
|
||||||
</CCallout>
|
</CCallout>
|
||||||
</CCol>
|
</CCol>
|
||||||
</CRow>
|
</CRow>
|
||||||
@@ -176,18 +186,18 @@
|
|||||||
<CCallout variant="warning">
|
<CCallout variant="warning">
|
||||||
<small class="text-muted">Pageviews</small><br>
|
<small class="text-muted">Pageviews</small><br>
|
||||||
<strong class="h4">78,623</strong>
|
<strong class="h4">78,623</strong>
|
||||||
<div :style="{ top: '-10px'}">
|
<!-- <div :style="{ top: '-10px'}">
|
||||||
<CalloutChartExample :data="[35, 23, 56, 22, 97, 23, 64]" variant="#f8cb00" width="80" height="30"/>
|
<CalloutChartExample :data="[35, 23, 56, 22, 97, 23, 64]" variant="#f8cb00" width="80" height="30"/>
|
||||||
</div>
|
</div> -->
|
||||||
</CCallout>
|
</CCallout>
|
||||||
</CCol>
|
</CCol>
|
||||||
<CCol sm="6">
|
<CCol sm="6">
|
||||||
<CCallout variant="success">
|
<CCallout variant="success">
|
||||||
<small class="text-muted">Organic</small><br>
|
<small class="text-muted">Organic</small><br>
|
||||||
<strong class="h4">49,123</strong>
|
<strong class="h4">49,123</strong>
|
||||||
<div :style="{ top: '-10px'}">
|
<!-- <div :style="{ top: '-10px'}">
|
||||||
<CalloutChartExample :data="[65, 59, 84, 84, 51, 55, 40]" variant="#4dbd74" width="80" height="30" />
|
<CalloutChartExample :data="[65, 59, 84, 84, 51, 55, 40]" variant="#4dbd74" width="80" height="30" />
|
||||||
</div>
|
</div> -->
|
||||||
</CCallout>
|
</CCallout>
|
||||||
</CCol>
|
</CCol>
|
||||||
</CRow>
|
</CRow>
|
||||||
@@ -333,20 +343,21 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MainChartExample from './dashboard/MainChartExample'
|
import MainChartExample from './charts/MainChartExample'
|
||||||
import WidgetsDropdown from './widgets/WidgetsDropdown'
|
import WidgetsDropdown from './widgets/WidgetsDropdown'
|
||||||
import WidgetsSocial from './widgets/WidgetsSocial'
|
import WidgetsSocial from './widgets/WidgetsSocial'
|
||||||
import SocialBoxChartExample from './dashboard/SocialBoxChartExample'
|
import CalloutChartExample from './charts/CalloutChartExample'
|
||||||
import CalloutChartExample from './dashboard/CalloutChartExample'
|
import CChartLineSimple from './charts/CChartLineSimple'
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Dashboard',
|
name: 'Dashboard',
|
||||||
components: {
|
components: {
|
||||||
MainChartExample,
|
MainChartExample,
|
||||||
SocialBoxChartExample,
|
|
||||||
CalloutChartExample,
|
CalloutChartExample,
|
||||||
WidgetsDropdown,
|
WidgetsDropdown,
|
||||||
WidgetsSocial
|
WidgetsSocial,
|
||||||
|
CChartLineSimple
|
||||||
},
|
},
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { Bar } from '@coreui/vue/src/extends/BaseCharts'
|
|
||||||
import { CustomTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'BarExample',
|
|
||||||
extends: Bar,
|
|
||||||
mounted () {
|
|
||||||
// Overwriting base render method with actual data.
|
|
||||||
this.renderChart(
|
|
||||||
{
|
|
||||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
|
||||||
datasets: [
|
|
||||||
{
|
|
||||||
label: 'GitHub Commits',
|
|
||||||
backgroundColor: '#f87979',
|
|
||||||
data: [40, 20, 12, 39, 10, 40, 39, 80, 40, 20, 12, 11]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
responsive: true,
|
|
||||||
maintainAspectRatio: true,
|
|
||||||
tooltips: {
|
|
||||||
enabled: false,
|
|
||||||
custom: CustomTooltips,
|
|
||||||
intersect: true,
|
|
||||||
mode: 'index',
|
|
||||||
position: 'nearest',
|
|
||||||
callbacks: {
|
|
||||||
labelColor: function (tooltipItem, chart) {
|
|
||||||
return { backgroundColor: chart.data.datasets[tooltipItem.datasetIndex].backgroundColor }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<template>
|
||||||
|
<CChartBar
|
||||||
|
:datasets="defaultDatasets"
|
||||||
|
labels="months"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { customTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
||||||
|
import { CChartBar } from '@coreui/coreui-vue-chartjs'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CChartBarExample',
|
||||||
|
components: { CChartBar },
|
||||||
|
computed: {
|
||||||
|
defaultDatasets () {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'GitHub Commits',
|
||||||
|
backgroundColor: '#f87979',
|
||||||
|
data: [40, 20, 12, 39, 10, 40, 39, 80, 40, 20, 12, 11]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
<template>
|
||||||
|
<CChartBar
|
||||||
|
:datasets="computedDatasets"
|
||||||
|
:options="computedOptions"
|
||||||
|
:labels="labels"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { CChartBar } from '@coreui/coreui-vue-chartjs'
|
||||||
|
import { getColor, deepObjectsMerge } from '@coreui/coreui/dist/js/coreui-utilities'
|
||||||
|
export default {
|
||||||
|
name: 'CChartBarSimple',
|
||||||
|
components: { CChartBar },
|
||||||
|
props: {
|
||||||
|
...CChartBar.props,
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'rgba(0,0,0,.2)'
|
||||||
|
},
|
||||||
|
pointHoverBackgroundColor: String,
|
||||||
|
dataPoints: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
type: String,
|
||||||
|
default: 'Sales'
|
||||||
|
},
|
||||||
|
pointed: Boolean
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
defaultDatasets () {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
data: this.dataPoints,
|
||||||
|
backgroundColor: getColor(this.backgroundColor),
|
||||||
|
pointHoverBackgroundColor: getColor(this.pointHoverBackgroundColor),
|
||||||
|
label: this.label
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
defaultOptions () {
|
||||||
|
return {
|
||||||
|
maintainAspectRatio: false,
|
||||||
|
legend: {
|
||||||
|
display: false
|
||||||
|
},
|
||||||
|
scales: {
|
||||||
|
xAxes: [{
|
||||||
|
display: false,
|
||||||
|
categoryPercentage: 1,
|
||||||
|
barPercentage: 0.5
|
||||||
|
}],
|
||||||
|
yAxes: [{
|
||||||
|
display: false
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computedDatasets () {
|
||||||
|
return deepObjectsMerge(this.defaultDatasets, this.datasets || {})
|
||||||
|
},
|
||||||
|
computedOptions () {
|
||||||
|
return deepObjectsMerge(this.defaultOptions, this.options || {})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<template>
|
||||||
|
<CChartDoughnut
|
||||||
|
:datasets="defaultDatasets"
|
||||||
|
:labels="['VueJs', 'EmberJs', 'ReactJs', 'AngularJs']"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { CChartDoughnut } from '@coreui/coreui-vue-chartjs'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CChartDoughnutExample',
|
||||||
|
components: { CChartDoughnut },
|
||||||
|
computed: {
|
||||||
|
defaultDatasets () {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
backgroundColor: [
|
||||||
|
'#41B883',
|
||||||
|
'#E46651',
|
||||||
|
'#00D8FF',
|
||||||
|
'#DD1B16'
|
||||||
|
],
|
||||||
|
data: [40, 20, 80, 10]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<template>
|
||||||
|
<CChartLine
|
||||||
|
:datasets="defaultDatasets"
|
||||||
|
labels="months"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { customTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
||||||
|
import { CChartLine } from '@coreui/coreui-vue-chartjs'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CChartLineExample',
|
||||||
|
components: { CChartLine },
|
||||||
|
computed: {
|
||||||
|
defaultDatasets () {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'Data One',
|
||||||
|
backgroundColor: 'rgb(228,102,81,0.9)',
|
||||||
|
data: [30, 39, 10, 50, 30, 70, 35]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Data Two',
|
||||||
|
backgroundColor: 'rgb(0,216,255,0.9)',
|
||||||
|
data: [39, 80, 40, 35, 40, 20, 45]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
<template>
|
||||||
|
<CChartLine
|
||||||
|
:datasets="computedDatasets"
|
||||||
|
:options="computedOptions"
|
||||||
|
:labels="labels"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { CChartLine } from '@coreui/coreui-vue-chartjs'
|
||||||
|
import { getColor, deepObjectsMerge } from '@coreui/coreui/dist/js/coreui-utilities'
|
||||||
|
export default {
|
||||||
|
name: 'CChartLineSimple',
|
||||||
|
components: { CChartLine },
|
||||||
|
props: {
|
||||||
|
...CChartLine.props,
|
||||||
|
borderColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'rgba(255,255,255,.55)'
|
||||||
|
},
|
||||||
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'transparent'
|
||||||
|
},
|
||||||
|
pointHoverBackgroundColor: String,
|
||||||
|
dataPoints: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
type: String,
|
||||||
|
default: 'Sales'
|
||||||
|
},
|
||||||
|
pointed: Boolean
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
defaultDatasets () {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
data: this.dataPoints,
|
||||||
|
borderColor: getColor(this.borderColor),
|
||||||
|
backgroundColor: getColor(this.backgroundColor),
|
||||||
|
pointHoverBackgroundColor: getColor(this.pointHoverBackgroundColor),
|
||||||
|
label: this.label
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
pointedOptions () {
|
||||||
|
return {
|
||||||
|
scales: {
|
||||||
|
xAxes: [
|
||||||
|
{
|
||||||
|
gridLines: {
|
||||||
|
color: 'transparent',
|
||||||
|
zeroLineColor: 'transparent'
|
||||||
|
},
|
||||||
|
ticks: {
|
||||||
|
fontSize: 2,
|
||||||
|
fontColor: 'transparent'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
yAxes: [
|
||||||
|
{
|
||||||
|
display: false,
|
||||||
|
ticks: {
|
||||||
|
display: false,
|
||||||
|
min: Math.min.apply(Math, this.dataPoints) - 5,
|
||||||
|
max: Math.max.apply(Math, this.dataPoints) + 5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
elements: {
|
||||||
|
line: {
|
||||||
|
borderWidth: 1
|
||||||
|
},
|
||||||
|
point: {
|
||||||
|
radius: 4,
|
||||||
|
hitRadius: 10,
|
||||||
|
hoverRadius: 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
straightOptions () {
|
||||||
|
return {
|
||||||
|
scales: {
|
||||||
|
xAxes: [{
|
||||||
|
display: false
|
||||||
|
}],
|
||||||
|
yAxes: [{
|
||||||
|
display: false
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
elements: {
|
||||||
|
line: {
|
||||||
|
borderWidth: 2
|
||||||
|
},
|
||||||
|
point: {
|
||||||
|
radius: 0,
|
||||||
|
hitRadius: 10,
|
||||||
|
hoverRadius: 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
defaultOptions () {
|
||||||
|
const options = this.pointed ? this.pointedOptions : this.straightOptions
|
||||||
|
return Object.assign({}, options, {
|
||||||
|
maintainAspectRatio: false,
|
||||||
|
legend: {
|
||||||
|
display: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
computedDatasets () {
|
||||||
|
return deepObjectsMerge(this.defaultDatasets, this.datasets || {})
|
||||||
|
},
|
||||||
|
computedOptions () {
|
||||||
|
return deepObjectsMerge(this.defaultOptions, this.options || {})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<template>
|
||||||
|
<CChartPie
|
||||||
|
:datasets="defaultDatasets"
|
||||||
|
:labels="['VueJs', 'EmberJs', 'ReactJs', 'AngularJs']"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { CChartPie } from '@coreui/coreui-vue-chartjs'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CChartPieExample',
|
||||||
|
components: { CChartPie },
|
||||||
|
computed: {
|
||||||
|
defaultDatasets () {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
backgroundColor: [
|
||||||
|
'#41B883',
|
||||||
|
'#E46651',
|
||||||
|
'#00D8FF',
|
||||||
|
'#DD1B16'
|
||||||
|
],
|
||||||
|
data: [40, 20, 80, 10]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<template>
|
||||||
|
<CChartPolarArea
|
||||||
|
:datasets="defaultDatasets"
|
||||||
|
:options="defaultOptions"
|
||||||
|
:labels="[
|
||||||
|
'Eating', 'Drinking', 'Sleeping', 'Designing',
|
||||||
|
'Coding', 'Cycling', 'Running'
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { customTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
||||||
|
import { CChartPolarArea } from '@coreui/coreui-vue-chartjs'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CChartPolarAreaExample',
|
||||||
|
components: { CChartPolarArea },
|
||||||
|
computed: {
|
||||||
|
defaultDatasets () {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'My First dataset',
|
||||||
|
backgroundColor: 'rgba(179,181,198,0.2)',
|
||||||
|
pointBackgroundColor: 'rgba(179,181,198,1)',
|
||||||
|
pointBorderColor: '#fff',
|
||||||
|
pointHoverBackgroundColor: 'rgba(179,181,198,1)',
|
||||||
|
pointHoverBorderColor: 'rgba(179,181,198,1)',
|
||||||
|
data: [65, 59, 90, 81, 56, 55, 40]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'My Second dataset',
|
||||||
|
backgroundColor: 'rgba(255,99,132,0.2)',
|
||||||
|
pointBackgroundColor: 'rgba(255,99,132,1)',
|
||||||
|
pointBorderColor: '#fff',
|
||||||
|
pointHoverBackgroundColor: 'rgba(255,99,132,1)',
|
||||||
|
pointHoverBorderColor: 'rgba(255,99,132,1)',
|
||||||
|
data: [28, 48, 40, 19, 96, 27, 100]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
defaultOptions () {
|
||||||
|
return {
|
||||||
|
aspectRatio: 1.5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,13 +1,24 @@
|
|||||||
|
<template>
|
||||||
|
<CChartRadar
|
||||||
|
:datasets="defaultDatasets"
|
||||||
|
:options="defaultOptions"
|
||||||
|
:labels="[
|
||||||
|
'Eating', 'Drinking', 'Sleeping', 'Designing',
|
||||||
|
'Coding', 'Cycling', 'Running'
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Radar } from '@coreui/vue/src/extends/BaseCharts'
|
import { customTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
||||||
import { CustomTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
import { CChartRadar } from '@coreui/coreui-vue-chartjs'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
extends: Radar,
|
name: 'CChartRadarExample',
|
||||||
mounted () {
|
components: { CChartRadar },
|
||||||
this.renderChart({
|
computed: {
|
||||||
labels: ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'],
|
defaultDatasets () {
|
||||||
datasets: [
|
return [
|
||||||
{
|
{
|
||||||
label: '2017',
|
label: '2017',
|
||||||
backgroundColor: 'rgba(179,181,198,0.2)',
|
backgroundColor: 'rgba(179,181,198,0.2)',
|
||||||
@@ -16,6 +27,7 @@ export default {
|
|||||||
pointBorderColor: '#fff',
|
pointBorderColor: '#fff',
|
||||||
pointHoverBackgroundColor: '#fff',
|
pointHoverBackgroundColor: '#fff',
|
||||||
pointHoverBorderColor: 'rgba(179,181,198,1)',
|
pointHoverBorderColor: 'rgba(179,181,198,1)',
|
||||||
|
tooltipLabelColor: 'rgba(179,181,198,1)',
|
||||||
data: [65, 59, 90, 81, 56, 55, 40]
|
data: [65, 59, 90, 81, 56, 55, 40]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -26,25 +38,16 @@ export default {
|
|||||||
pointBorderColor: '#fff',
|
pointBorderColor: '#fff',
|
||||||
pointHoverBackgroundColor: '#fff',
|
pointHoverBackgroundColor: '#fff',
|
||||||
pointHoverBorderColor: 'rgba(255,99,132,1)',
|
pointHoverBorderColor: 'rgba(255,99,132,1)',
|
||||||
|
tooltipLabelColor: 'rgba(255,99,132,1)',
|
||||||
data: [28, 48, 40, 19, 96, 27, 100]
|
data: [28, 48, 40, 19, 96, 27, 100]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}, {
|
},
|
||||||
responsive: true,
|
defaultOptions () {
|
||||||
maintainAspectRatio: true,
|
return {
|
||||||
tooltips: {
|
aspectRatio: 1.5
|
||||||
enabled: false,
|
|
||||||
custom: CustomTooltips,
|
|
||||||
intersect: true,
|
|
||||||
mode: 'index',
|
|
||||||
position: 'nearest',
|
|
||||||
callbacks: {
|
|
||||||
labelColor: function (tooltipItem, chart) {
|
|
||||||
return { backgroundColor: chart.data.datasets[tooltipItem.datasetIndex].borderColor }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
<template>
|
||||||
|
<CChartLine
|
||||||
|
:datasets="defaultDatasets"
|
||||||
|
:options="defaultOptions"
|
||||||
|
:labels="['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { CChartLine } from '@coreui/coreui-vue-chartjs'
|
||||||
|
import { customTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
||||||
|
import { getColor } from '@coreui/coreui/dist/js/coreui-utilities'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
CChartLine
|
||||||
|
},
|
||||||
|
props: ['data', 'borderColor'],
|
||||||
|
computed: {
|
||||||
|
defaultDatasets () {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
backgroundColor: 'transparent',
|
||||||
|
borderColor: getColor(this.borderColor) || '#c2cfd6',
|
||||||
|
data: this.data
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
defaultOptions () {
|
||||||
|
return {
|
||||||
|
tooltips: {
|
||||||
|
enabled: false,
|
||||||
|
custom: customTooltips,
|
||||||
|
intersect: true,
|
||||||
|
mode: 'index',
|
||||||
|
position: 'nearest',
|
||||||
|
callbacks: {
|
||||||
|
labelColor: function (tooltipItem, chart) {
|
||||||
|
return { backgroundColor: chart.data.datasets[tooltipItem.datasetIndex].backgroundColor }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scales: {
|
||||||
|
xAxes: [{
|
||||||
|
display: false
|
||||||
|
}],
|
||||||
|
yAxes: [{
|
||||||
|
display: false
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
elements: {
|
||||||
|
line: {
|
||||||
|
borderWidth: 2
|
||||||
|
},
|
||||||
|
point: {
|
||||||
|
radius: 0,
|
||||||
|
hitRadius: 10,
|
||||||
|
hoverRadius: 4,
|
||||||
|
hoverBorderWidth: 3
|
||||||
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
display: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getVariant (val, el) {
|
||||||
|
return val[0] === '#' ? val : getStyle(`--${val}`, el)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { Doughnut } from '@coreui/vue/src/extends/BaseCharts'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'DoughnutExample',
|
|
||||||
extends: Doughnut,
|
|
||||||
mounted () {
|
|
||||||
this.renderChart({
|
|
||||||
labels: ['VueJs', 'EmberJs', 'ReactJs', 'AngularJs'],
|
|
||||||
datasets: [
|
|
||||||
{
|
|
||||||
backgroundColor: [
|
|
||||||
'#41B883',
|
|
||||||
'#E46651',
|
|
||||||
'#00D8FF',
|
|
||||||
'#DD1B16'
|
|
||||||
],
|
|
||||||
data: [40, 20, 80, 10]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}, {responsive: true, maintainAspectRatio: true})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { Line } from '@coreui/vue/src/extends/BaseCharts'
|
|
||||||
import { CustomTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
|
||||||
import { hexToRgba } from '@coreui/coreui/dist/js/coreui-utilities'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
hexToRgba,
|
|
||||||
CustomTooltips
|
|
||||||
},
|
|
||||||
extends: Line,
|
|
||||||
mounted () {
|
|
||||||
this.renderChart(
|
|
||||||
{
|
|
||||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
|
||||||
datasets: [
|
|
||||||
{
|
|
||||||
label: 'Data One',
|
|
||||||
backgroundColor: hexToRgba('#E46651', 90),
|
|
||||||
data: [30, 39, 10, 50, 30, 70, 35]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Data Two',
|
|
||||||
backgroundColor: hexToRgba('#00D8FF', 90),
|
|
||||||
data: [39, 80, 40, 35, 40, 20, 45]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
responsive: true,
|
|
||||||
maintainAspectRatio: true,
|
|
||||||
tooltips: {
|
|
||||||
enabled: false,
|
|
||||||
custom: CustomTooltips,
|
|
||||||
intersect: true,
|
|
||||||
mode: 'index',
|
|
||||||
position: 'nearest',
|
|
||||||
callbacks: {
|
|
||||||
labelColor: function (tooltipItem, chart) {
|
|
||||||
return { backgroundColor: chart.data.datasets[tooltipItem.datasetIndex].backgroundColor }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -0,0 +1,191 @@
|
|||||||
|
<template>
|
||||||
|
<CChartLine
|
||||||
|
:datasets="defaultDatasets"
|
||||||
|
:options="defaultOptions"
|
||||||
|
:labels="['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su']"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { CChartLine } from '@coreui/coreui-vue-chartjs'
|
||||||
|
import { getColor, hexToRgba } from '@coreui/coreui/dist/js/coreui-utilities'
|
||||||
|
import { customTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
||||||
|
|
||||||
|
function random (min, max) {
|
||||||
|
return Math.floor(Math.random() * (max - min + 1) + min)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
CChartLine
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
defaultDatasets () {
|
||||||
|
const brandSuccess = getColor('success') || '#4dbd74'
|
||||||
|
const brandInfo = getColor('info') || '#20a8d8'
|
||||||
|
const brandDanger = getColor('danger') || '#f86c6b'
|
||||||
|
|
||||||
|
let elements = 27
|
||||||
|
const data1 = []
|
||||||
|
const data2 = []
|
||||||
|
const data3 = []
|
||||||
|
|
||||||
|
for (let i = 0; i <= elements; i++) {
|
||||||
|
data1.push(random(50, 200))
|
||||||
|
data2.push(random(80, 100))
|
||||||
|
data3.push(65)
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'My First dataset',
|
||||||
|
backgroundColor: hexToRgba(brandInfo, 10),
|
||||||
|
borderColor: brandInfo,
|
||||||
|
pointHoverBackgroundColor: '#fff',
|
||||||
|
borderWidth: 2,
|
||||||
|
data: data1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'My Second dataset',
|
||||||
|
backgroundColor: 'transparent',
|
||||||
|
borderColor: brandSuccess,
|
||||||
|
pointHoverBackgroundColor: '#fff',
|
||||||
|
borderWidth: 2,
|
||||||
|
data: data2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'My Third dataset',
|
||||||
|
backgroundColor: 'transparent',
|
||||||
|
borderColor: brandDanger,
|
||||||
|
pointHoverBackgroundColor: '#fff',
|
||||||
|
borderWidth: 1,
|
||||||
|
borderDash: [8, 5],
|
||||||
|
data: data3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
defaultOptions () {
|
||||||
|
return {
|
||||||
|
|
||||||
|
maintainAspectRatio: false,
|
||||||
|
legend: {
|
||||||
|
display: false
|
||||||
|
},
|
||||||
|
scales: {
|
||||||
|
xAxes: [{
|
||||||
|
gridLines: {
|
||||||
|
drawOnChartArea: false
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
yAxes: [{
|
||||||
|
ticks: {
|
||||||
|
beginAtZero: true,
|
||||||
|
maxTicksLimit: 5,
|
||||||
|
stepSize: Math.ceil(250 / 5),
|
||||||
|
max: 250
|
||||||
|
},
|
||||||
|
gridLines: {
|
||||||
|
display: true
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
elements: {
|
||||||
|
point: {
|
||||||
|
radius: 0,
|
||||||
|
hitRadius: 10,
|
||||||
|
hoverRadius: 4,
|
||||||
|
hoverBorderWidth: 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// mounted () {
|
||||||
|
// const brandSuccess = getStyle('--success') || '#4dbd74'
|
||||||
|
// const brandInfo = getStyle('--info') || '#20a8d8'
|
||||||
|
// const brandDanger = getStyle('--danger') || '#f86c6b'
|
||||||
|
//
|
||||||
|
// let elements = 27
|
||||||
|
// const data1 = []
|
||||||
|
// const data2 = []
|
||||||
|
// const data3 = []
|
||||||
|
//
|
||||||
|
// for (let i = 0; i <= elements; i++) {
|
||||||
|
// data1.push(random(50, 200))
|
||||||
|
// data2.push(random(80, 100))
|
||||||
|
// data3.push(65)
|
||||||
|
// }
|
||||||
|
// this.renderChart({
|
||||||
|
// datasets: [
|
||||||
|
// {
|
||||||
|
// label: 'My First dataset',
|
||||||
|
// backgroundColor: hexToRgba(brandInfo, 10),
|
||||||
|
// borderColor: brandInfo,
|
||||||
|
// pointHoverBackgroundColor: '#fff',
|
||||||
|
// borderWidth: 2,
|
||||||
|
// data: data1
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: 'My Second dataset',
|
||||||
|
// backgroundColor: 'transparent',
|
||||||
|
// borderColor: brandSuccess,
|
||||||
|
// pointHoverBackgroundColor: '#fff',
|
||||||
|
// borderWidth: 2,
|
||||||
|
// data: data2
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: 'My Third dataset',
|
||||||
|
// backgroundColor: 'transparent',
|
||||||
|
// borderColor: brandDanger,
|
||||||
|
// pointHoverBackgroundColor: '#fff',
|
||||||
|
// borderWidth: 1,
|
||||||
|
// borderDash: [8, 5],
|
||||||
|
// data: data3
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }, {
|
||||||
|
// tooltips: {
|
||||||
|
// enabled: false,
|
||||||
|
// custom: CustomTooltips,
|
||||||
|
// intersect: true,
|
||||||
|
// mode: 'index',
|
||||||
|
// position: 'nearest',
|
||||||
|
// callbacks: {
|
||||||
|
// labelColor: function (tooltipItem, chart) {
|
||||||
|
// return { backgroundColor: chart.data.datasets[tooltipItem.datasetIndex].borderColor }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// maintainAspectRatio: false,
|
||||||
|
// legend: {
|
||||||
|
// display: false
|
||||||
|
// },
|
||||||
|
// scales: {
|
||||||
|
// xAxes: [{
|
||||||
|
// gridLines: {
|
||||||
|
// drawOnChartArea: false
|
||||||
|
// }
|
||||||
|
// }],
|
||||||
|
// yAxes: [{
|
||||||
|
// ticks: {
|
||||||
|
// beginAtZero: true,
|
||||||
|
// maxTicksLimit: 5,
|
||||||
|
// stepSize: Math.ceil(250 / 5),
|
||||||
|
// max: 250
|
||||||
|
// },
|
||||||
|
// gridLines: {
|
||||||
|
// display: true
|
||||||
|
// }
|
||||||
|
// }]
|
||||||
|
// },
|
||||||
|
// elements: {
|
||||||
|
// point: {
|
||||||
|
// radius: 0,
|
||||||
|
// hitRadius: 10,
|
||||||
|
// hoverRadius: 4,
|
||||||
|
// hoverBorderWidth: 3
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { Pie } from '@coreui/vue/src/extends/BaseCharts'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
extends: Pie,
|
|
||||||
mounted () {
|
|
||||||
this.renderChart({
|
|
||||||
labels: ['VueJs', 'EmberJs', 'ReactJs', 'AngularJs'],
|
|
||||||
datasets: [
|
|
||||||
{
|
|
||||||
backgroundColor: [
|
|
||||||
'#41B883',
|
|
||||||
'#E46651',
|
|
||||||
'#00D8FF',
|
|
||||||
'#DD1B16'
|
|
||||||
],
|
|
||||||
data: [40, 20, 80, 10]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}, {responsive: true, maintainAspectRatio: true})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { PolarArea } from '@coreui/vue/src/extends/BaseCharts'
|
|
||||||
import { CustomTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
extends: PolarArea,
|
|
||||||
mounted () {
|
|
||||||
this.renderChart({
|
|
||||||
labels: ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'],
|
|
||||||
datasets: [
|
|
||||||
{
|
|
||||||
label: 'My First dataset',
|
|
||||||
backgroundColor: 'rgba(179,181,198,0.2)',
|
|
||||||
pointBackgroundColor: 'rgba(179,181,198,1)',
|
|
||||||
pointBorderColor: '#fff',
|
|
||||||
pointHoverBackgroundColor: '#fff',
|
|
||||||
pointHoverBorderColor: 'rgba(179,181,198,1)',
|
|
||||||
data: [65, 59, 90, 81, 56, 55, 40]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'My Second dataset',
|
|
||||||
backgroundColor: 'rgba(255,99,132,0.2)',
|
|
||||||
pointBackgroundColor: 'rgba(255,99,132,1)',
|
|
||||||
pointBorderColor: '#fff',
|
|
||||||
pointHoverBackgroundColor: '#fff',
|
|
||||||
pointHoverBorderColor: 'rgba(255,99,132,1)',
|
|
||||||
data: [28, 48, 40, 19, 96, 27, 100]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}, {
|
|
||||||
responsive: true,
|
|
||||||
maintainAspectRatio: false,
|
|
||||||
tooltips: {
|
|
||||||
enabled: false,
|
|
||||||
custom: CustomTooltips,
|
|
||||||
intersect: true,
|
|
||||||
mode: 'index',
|
|
||||||
position: 'nearest',
|
|
||||||
callbacks: {
|
|
||||||
labelColor: function (tooltipItem, chart) {
|
|
||||||
return { backgroundColor: chart.data.datasets[tooltipItem.datasetIndex].backgroundColor }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import CChartLineSimple from './CChartLineSimple'
|
||||||
|
import CChartBarSimple from './CChartBarSimple'
|
||||||
|
import CChartLineExample from './CChartLineExample'
|
||||||
|
import CChartBarExample from './CChartBarExample'
|
||||||
|
import CChartDoughnutExample from './CChartDoughnutExample'
|
||||||
|
import CChartRadarExample from './CChartRadarExample'
|
||||||
|
import CChartPieExample from './CChartPieExample'
|
||||||
|
import CChartPolarAreaExample from './CChartPolarAreaExample'
|
||||||
|
|
||||||
|
export {
|
||||||
|
CChartLineSimple,
|
||||||
|
CChartBarSimple,
|
||||||
|
CChartLineExample,
|
||||||
|
CChartBarExample,
|
||||||
|
CChartDoughnutExample,
|
||||||
|
CChartRadarExample,
|
||||||
|
CChartPieExample,
|
||||||
|
CChartPolarAreaExample
|
||||||
|
}
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { Line } from '@coreui/vue/src/extends/BaseCharts'
|
|
||||||
import { CustomTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
|
||||||
import { getStyle } from '@coreui/coreui/dist/js/coreui-utilities'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
CustomTooltips
|
|
||||||
},
|
|
||||||
extends: Line,
|
|
||||||
props: ['data', 'height', 'width', 'variant'],
|
|
||||||
mounted () {
|
|
||||||
this.renderChart({
|
|
||||||
labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
|
|
||||||
datasets: [
|
|
||||||
{
|
|
||||||
backgroundColor: 'transparent',
|
|
||||||
borderColor: this.getVariant(this.variant) || '#c2cfd6',
|
|
||||||
data: this.data
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}, {
|
|
||||||
responsive: true,
|
|
||||||
tooltips: {
|
|
||||||
enabled: false,
|
|
||||||
custom: CustomTooltips,
|
|
||||||
intersect: true,
|
|
||||||
mode: 'index',
|
|
||||||
position: 'nearest',
|
|
||||||
callbacks: {
|
|
||||||
labelColor: function (tooltipItem, chart) {
|
|
||||||
return { backgroundColor: chart.data.datasets[tooltipItem.datasetIndex].borderColor }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
maintainAspectRatio: true,
|
|
||||||
scales: {
|
|
||||||
xAxes: [{
|
|
||||||
display: false
|
|
||||||
}],
|
|
||||||
yAxes: [{
|
|
||||||
display: false
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
elements: {
|
|
||||||
line: {
|
|
||||||
borderWidth: 2
|
|
||||||
},
|
|
||||||
point: {
|
|
||||||
radius: 0,
|
|
||||||
hitRadius: 10,
|
|
||||||
hoverRadius: 4,
|
|
||||||
hoverBorderWidth: 3
|
|
||||||
}
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
display: false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getVariant (val, el) {
|
|
||||||
return val[0] === '#' ? val : getStyle(`--${val}`, el)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { Bar } from '@coreui/vue/src/extends/BaseCharts'
|
|
||||||
import { CustomTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
extends: Bar,
|
|
||||||
props: ['height'],
|
|
||||||
mounted () {
|
|
||||||
const datasets4 = [
|
|
||||||
{
|
|
||||||
label: 'My First dataset',
|
|
||||||
backgroundColor: 'rgba(255,255,255,.3)',
|
|
||||||
borderColor: 'transparent',
|
|
||||||
data: [78, 81, 80, 45, 34, 12, 40, 75, 34, 89, 32, 68, 54, 72, 18, 98]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
this.renderChart(
|
|
||||||
{
|
|
||||||
labels: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''],
|
|
||||||
datasets: datasets4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
tooltips: {
|
|
||||||
enabled: false,
|
|
||||||
custom: CustomTooltips
|
|
||||||
},
|
|
||||||
maintainAspectRatio: false,
|
|
||||||
legend: {
|
|
||||||
display: false
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
xAxes: [{
|
|
||||||
display: false,
|
|
||||||
categoryPercentage: 1,
|
|
||||||
barPercentage: 0.5
|
|
||||||
}],
|
|
||||||
yAxes: [{
|
|
||||||
display: false
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { Line } from '@coreui/vue/src/extends/BaseCharts'
|
|
||||||
import { CustomTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
|
||||||
import { getStyle } from '@coreui/coreui/dist/js/coreui-utilities'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
extends: Line,
|
|
||||||
props: ['height', 'width'],
|
|
||||||
mounted () {
|
|
||||||
const brandPrimary = getStyle('--primary') || '#20a8d8'
|
|
||||||
const datasets1 = [
|
|
||||||
{
|
|
||||||
label: 'My First dataset',
|
|
||||||
backgroundColor: brandPrimary,
|
|
||||||
borderColor: 'rgba(255,255,255,.55)',
|
|
||||||
data: [65, 59, 84, 84, 51, 55, 40]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
this.renderChart(
|
|
||||||
{
|
|
||||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
|
||||||
datasets: datasets1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
tooltips: {
|
|
||||||
enabled: false,
|
|
||||||
custom: CustomTooltips
|
|
||||||
},
|
|
||||||
maintainAspectRatio: false,
|
|
||||||
legend: {
|
|
||||||
display: false
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
xAxes: [
|
|
||||||
{
|
|
||||||
gridLines: {
|
|
||||||
color: 'transparent',
|
|
||||||
zeroLineColor: 'transparent'
|
|
||||||
},
|
|
||||||
ticks: {
|
|
||||||
fontSize: 2,
|
|
||||||
fontColor: 'transparent'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
yAxes: [
|
|
||||||
{
|
|
||||||
display: false,
|
|
||||||
ticks: {
|
|
||||||
display: false,
|
|
||||||
min: Math.min.apply(Math, datasets1[0].data) - 5,
|
|
||||||
max: Math.max.apply(Math, datasets1[0].data) + 5
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
elements: {
|
|
||||||
line: {
|
|
||||||
borderWidth: 1
|
|
||||||
},
|
|
||||||
point: {
|
|
||||||
radius: 4,
|
|
||||||
hitRadius: 10,
|
|
||||||
hoverRadius: 4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { Line } from '@coreui/vue/src/extends/BaseCharts'
|
|
||||||
import { CustomTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
|
||||||
import { getStyle } from '@coreui/coreui/dist/js/coreui-utilities'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
extends: Line,
|
|
||||||
props: ['height', 'width'],
|
|
||||||
mounted () {
|
|
||||||
const brandInfo = getStyle('--light-blue') || '#63c2de'
|
|
||||||
const datasets2 = [
|
|
||||||
{
|
|
||||||
label: 'My First dataset',
|
|
||||||
backgroundColor: brandInfo,
|
|
||||||
borderColor: 'rgba(255,255,255,.55)',
|
|
||||||
data: [1, 18, 9, 17, 34, 22, 11]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
this.renderChart(
|
|
||||||
{
|
|
||||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
|
||||||
datasets: datasets2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
tooltips: {
|
|
||||||
enabled: false,
|
|
||||||
custom: CustomTooltips
|
|
||||||
},
|
|
||||||
maintainAspectRatio: false,
|
|
||||||
legend: {
|
|
||||||
display: false
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
xAxes: [
|
|
||||||
{
|
|
||||||
gridLines: {
|
|
||||||
color: 'transparent',
|
|
||||||
zeroLineColor: 'transparent'
|
|
||||||
},
|
|
||||||
ticks: {
|
|
||||||
fontSize: 2,
|
|
||||||
fontColor: 'transparent'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
yAxes: [
|
|
||||||
{
|
|
||||||
display: false,
|
|
||||||
ticks: {
|
|
||||||
display: false,
|
|
||||||
min: Math.min.apply(Math, datasets2[0].data) - 5,
|
|
||||||
max: Math.max.apply(Math, datasets2[0].data) + 5
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
elements: {
|
|
||||||
line: {
|
|
||||||
tension: 0.00001,
|
|
||||||
borderWidth: 1
|
|
||||||
},
|
|
||||||
point: {
|
|
||||||
radius: 4,
|
|
||||||
hitRadius: 10,
|
|
||||||
hoverRadius: 4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { Line } from '@coreui/vue/src/extends/BaseCharts'
|
|
||||||
import { CustomTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
extends: Line,
|
|
||||||
props: ['height', 'width'],
|
|
||||||
mounted () {
|
|
||||||
const datasets3 = [
|
|
||||||
{
|
|
||||||
label: 'My First dataset',
|
|
||||||
backgroundColor: 'rgba(255,255,255,.2)',
|
|
||||||
borderColor: 'rgba(255,255,255,.55)',
|
|
||||||
data: [78, 81, 80, 45, 34, 12, 40]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
this.renderChart(
|
|
||||||
{
|
|
||||||
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
|
||||||
datasets: datasets3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
tooltips: {
|
|
||||||
enabled: false,
|
|
||||||
custom: CustomTooltips
|
|
||||||
},
|
|
||||||
maintainAspectRatio: false,
|
|
||||||
legend: {
|
|
||||||
display: false
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
xAxes: [{
|
|
||||||
display: false
|
|
||||||
}],
|
|
||||||
yAxes: [{
|
|
||||||
display: false
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
elements: {
|
|
||||||
line: {
|
|
||||||
borderWidth: 2
|
|
||||||
},
|
|
||||||
point: {
|
|
||||||
radius: 0,
|
|
||||||
hitRadius: 10,
|
|
||||||
hoverRadius: 4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { Line } from '@coreui/vue/src/extends/BaseCharts'
|
|
||||||
import { getStyle, hexToRgba } from '@coreui/coreui/dist/js/coreui-utilities'
|
|
||||||
import { CustomTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
|
||||||
|
|
||||||
function random (min, max) {
|
|
||||||
return Math.floor(Math.random() * (max - min + 1) + min)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default {
|
|
||||||
extends: Line,
|
|
||||||
props: ['height'],
|
|
||||||
mounted () {
|
|
||||||
const brandSuccess = getStyle('--success') || '#4dbd74'
|
|
||||||
const brandInfo = getStyle('--info') || '#20a8d8'
|
|
||||||
const brandDanger = getStyle('--danger') || '#f86c6b'
|
|
||||||
|
|
||||||
let elements = 27
|
|
||||||
const data1 = []
|
|
||||||
const data2 = []
|
|
||||||
const data3 = []
|
|
||||||
|
|
||||||
for (let i = 0; i <= elements; i++) {
|
|
||||||
data1.push(random(50, 200))
|
|
||||||
data2.push(random(80, 100))
|
|
||||||
data3.push(65)
|
|
||||||
}
|
|
||||||
this.renderChart({
|
|
||||||
labels: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'],
|
|
||||||
datasets: [
|
|
||||||
{
|
|
||||||
label: 'My First dataset',
|
|
||||||
backgroundColor: hexToRgba(brandInfo, 10),
|
|
||||||
borderColor: brandInfo,
|
|
||||||
pointHoverBackgroundColor: '#fff',
|
|
||||||
borderWidth: 2,
|
|
||||||
data: data1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'My Second dataset',
|
|
||||||
backgroundColor: 'transparent',
|
|
||||||
borderColor: brandSuccess,
|
|
||||||
pointHoverBackgroundColor: '#fff',
|
|
||||||
borderWidth: 2,
|
|
||||||
data: data2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'My Third dataset',
|
|
||||||
backgroundColor: 'transparent',
|
|
||||||
borderColor: brandDanger,
|
|
||||||
pointHoverBackgroundColor: '#fff',
|
|
||||||
borderWidth: 1,
|
|
||||||
borderDash: [8, 5],
|
|
||||||
data: data3
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}, {
|
|
||||||
tooltips: {
|
|
||||||
enabled: false,
|
|
||||||
custom: CustomTooltips,
|
|
||||||
intersect: true,
|
|
||||||
mode: 'index',
|
|
||||||
position: 'nearest',
|
|
||||||
callbacks: {
|
|
||||||
labelColor: function (tooltipItem, chart) {
|
|
||||||
return { backgroundColor: chart.data.datasets[tooltipItem.datasetIndex].borderColor }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
maintainAspectRatio: false,
|
|
||||||
legend: {
|
|
||||||
display: false
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
xAxes: [{
|
|
||||||
gridLines: {
|
|
||||||
drawOnChartArea: false
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
yAxes: [{
|
|
||||||
ticks: {
|
|
||||||
beginAtZero: true,
|
|
||||||
maxTicksLimit: 5,
|
|
||||||
stepSize: Math.ceil(250 / 5),
|
|
||||||
max: 250
|
|
||||||
},
|
|
||||||
gridLines: {
|
|
||||||
display: true
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
elements: {
|
|
||||||
point: {
|
|
||||||
radius: 0,
|
|
||||||
hitRadius: 10,
|
|
||||||
hoverRadius: 4,
|
|
||||||
hoverBorderWidth: 3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { Line } from '@coreui/vue/src/extends/BaseCharts'
|
|
||||||
import { CustomTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'SocialBoxChartExample',
|
|
||||||
extends: Line,
|
|
||||||
props: {
|
|
||||||
data: {
|
|
||||||
type: Array,
|
|
||||||
default: () => [0, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]
|
|
||||||
},
|
|
||||||
height: {
|
|
||||||
type: String,
|
|
||||||
default: '100'
|
|
||||||
},
|
|
||||||
label:{
|
|
||||||
type: String,
|
|
||||||
default: 'label|string'
|
|
||||||
},
|
|
||||||
labels:{
|
|
||||||
type: Array,
|
|
||||||
default () {
|
|
||||||
return(['January', 'February', 'March', 'April', 'May', 'June', 'July','August','September','October','November','December'])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
this.renderChart({
|
|
||||||
labels: this.labels,
|
|
||||||
datasets: [
|
|
||||||
{
|
|
||||||
label: this.label,
|
|
||||||
backgroundColor: 'rgba(255,255,255,.1)',
|
|
||||||
borderColor: 'rgba(255,255,255,.55)',
|
|
||||||
pointHoverBackgroundColor: '#fff',
|
|
||||||
borderWidth: 2,
|
|
||||||
data: this.data
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}, {
|
|
||||||
tooltips: {
|
|
||||||
enabled: false,
|
|
||||||
custom: CustomTooltips
|
|
||||||
},
|
|
||||||
responsive: true,
|
|
||||||
maintainAspectRatio: false,
|
|
||||||
legend: {
|
|
||||||
display: false
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
xAxes: [{
|
|
||||||
display: false
|
|
||||||
}],
|
|
||||||
yAxes: [{
|
|
||||||
display: false
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
elements: {
|
|
||||||
point: {
|
|
||||||
radius: 0,
|
|
||||||
hitRadius: 10,
|
|
||||||
hoverRadius: 4,
|
|
||||||
hoverBorderWidth: 3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -264,70 +264,58 @@
|
|||||||
<CRow>
|
<CRow>
|
||||||
<CCol sm="6" lg="3">
|
<CCol sm="6" lg="3">
|
||||||
<CWidgetSmallText rightHeader='SALE' rightFooter='Today 6:43 AM' leftHeader='$1.890,65' leftFooter='+432,50 (15,78%)'>
|
<CWidgetSmallText rightHeader='SALE' rightFooter='Today 6:43 AM' leftHeader='$1.890,65' leftFooter='+432,50 (15,78%)'>
|
||||||
<CSimpleLineChart style="height:40px" chartId="CWidgetSmallText_line1" :data='[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]' label='Sales'/>
|
<CChartLineSimple style="height:40px"/>
|
||||||
<CSimpleBarChart style="height:40px"
|
<CChartBarSimple style="height:40px"/>
|
||||||
:data="[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]"
|
|
||||||
label="Sales"
|
|
||||||
/>
|
|
||||||
</CWidgetSmallText>
|
</CWidgetSmallText>
|
||||||
</CCol>
|
</CCol>
|
||||||
<CCol sm="6" lg="3">
|
<CCol sm="6" lg="3">
|
||||||
<CWidgetSmallText variant='success' rightHeader='SALE' rightFooter='Today 6:43 AM' leftHeader='$1.890,65' leftFooter='+432,50 (15,78%)'>
|
<CWidgetSmallText variant='success' rightHeader='SALE' rightFooter='Today 6:43 AM' leftHeader='$1.890,65' leftFooter='+432,50 (15,78%)'>
|
||||||
<CSimpleLineChart style="height:40px" chartId="CWidgetSmallText_line2" :data='[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]' label='Sales'/>
|
<CChartLineSimple style="height:40px"/>
|
||||||
<CSimpleBarChart style="height:40px" chartId="CWidgetSmallText_bar2" :data='[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]' label='Sales'/>
|
<CChartBarSimple style="height:40px"/>
|
||||||
</CWidgetSmallText>
|
</CWidgetSmallText>
|
||||||
</CCol>
|
</CCol>
|
||||||
<CCol sm="6" lg="3">
|
<CCol sm="6" lg="3">
|
||||||
<CWidgetSmallText variant='danger' rightHeader='SALE' rightFooter='Today 6:43 AM' leftHeader='$1.890,65' leftFooter='+432,50 (15,78%)'>
|
<CWidgetSmallText variant='danger' rightHeader='SALE' rightFooter='Today 6:43 AM' leftHeader='$1.890,65' leftFooter='+432,50 (15,78%)'>
|
||||||
<CSimpleLineChart style="height:40px" chartId="CWidgetSmallText_line3" :data='[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]' label='Sales'/>
|
<CChartLineSimple style="height:40px"/>
|
||||||
<CSimpleBarChart style="height:40px" chartId="CWidgetSmallText_bar3" :data='[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]' label='Sales'/>
|
<CChartBarSimple style="height:40px"/>
|
||||||
</CWidgetSmallText>
|
</CWidgetSmallText>
|
||||||
</CCol>
|
</CCol>
|
||||||
<CCol sm="6" lg="3">
|
<CCol sm="6" lg="3">
|
||||||
<CWidgetSmallText variant='warning' rightHeader='SALE' rightFooter='Today 6:43 AM' leftHeader='$1.890,65' leftFooter='+432,50 (15,78%)'>
|
<CWidgetSmallText variant='warning' rightHeader='SALE' rightFooter='Today 6:43 AM' leftHeader='$1.890,65' leftFooter='+432,50 (15,78%)'>
|
||||||
<CSimpleLineChart style="height:40px" chartId="CWidgetSmallText_line4" :data='[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]' label='Sales'/>
|
<CChartLineSimple style="height:40px"/>
|
||||||
<CSimpleBarChart style="height:40px" chartId="CWidgetSmallText_bar4" :data='[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]' label='Sales'/>
|
<CChartBarSimple style="height:40px"/>
|
||||||
</CWidgetSmallText>
|
</CWidgetSmallText>
|
||||||
</CCol>
|
</CCol>
|
||||||
</CRow>
|
</CRow>
|
||||||
<CRow>
|
<CRow>
|
||||||
<CCol sm="4" lg="2">
|
<CCol sm="4" lg="2">
|
||||||
<CWidgetSimple header='title' text='1,123'>
|
<CWidgetSimple header='title' text='1,123'>
|
||||||
<CSimpleLineChart style="height:40px" chartId="CWidgetSimple_1" :data='[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]'
|
<CChartLineSimple style="height:40px" borderColor="danger"/>
|
||||||
label='Sales' borderColor='danger'/>
|
|
||||||
</CWidgetSimple>
|
</CWidgetSimple>
|
||||||
</CCol>
|
</CCol>
|
||||||
<CCol sm="4" lg="2">
|
<CCol sm="4" lg="2">
|
||||||
<CWidgetSimple header='title' text='1,123'>
|
<CWidgetSimple header='title' text='1,123'>
|
||||||
<CSimpleLineChart style="height:40px" :data='[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]'
|
<CChartLineSimple style="height:40px" borderColor="primary"/>
|
||||||
label='Sales' borderColor='primary'/>
|
|
||||||
</CWidgetSimple>
|
</CWidgetSimple>
|
||||||
</CCol>
|
</CCol>
|
||||||
<CCol sm="4" lg="2">
|
<CCol sm="4" lg="2">
|
||||||
<CWidgetSimple header='title' text='1,123'>
|
<CWidgetSimple header='title' text='1,123'>
|
||||||
<CSimpleLineChart style="height:40px"
|
<CChartLineSimple style="height:40px" borderColor="success"/>
|
||||||
:data="[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]"
|
|
||||||
label="Sales"
|
|
||||||
borderColor="success"
|
|
||||||
/>
|
|
||||||
</CWidgetSimple>
|
</CWidgetSimple>
|
||||||
</CCol>
|
</CCol>
|
||||||
<CCol sm="4" lg="2">
|
<CCol sm="4" lg="2">
|
||||||
<CWidgetSimple header='title' text='1,123'>
|
<CWidgetSimple header='title' text='1,123'>
|
||||||
<CSimpleBarChart style="height:40px" chartId="CWidgetSimple_4" :data='[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]'
|
<CChartBarSimple style="height:40px" backgroundColor="danger"/>
|
||||||
label='Sales' color='danger'/>
|
|
||||||
</CWidgetSimple>
|
</CWidgetSimple>
|
||||||
</CCol>
|
</CCol>
|
||||||
<CCol sm="4" lg="2">
|
<CCol sm="4" lg="2">
|
||||||
<CWidgetSimple header='title' text='1,123'>
|
<CWidgetSimple header='title' text='1,123'>
|
||||||
<CSimpleBarChart style="height:40px" chartId="CWidgetSimple_5" :data='[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]'
|
<CChartBarSimple style="height:40px" backgroundColor="primary"/>
|
||||||
label='Sales' color='primary'/>
|
|
||||||
</CWidgetSimple>
|
</CWidgetSimple>
|
||||||
</CCol>
|
</CCol>
|
||||||
<CCol sm="4" lg="2">
|
<CCol sm="4" lg="2">
|
||||||
<CWidgetSimple header='title' text='1,123'>
|
<CWidgetSimple header='title' text='1,123'>
|
||||||
<CSimpleBarChart style="height:40px" :data='[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]'
|
<CChartBarSimple style="height:40px" backgroundColor="success"/>
|
||||||
label='Sales' color='success'/>
|
|
||||||
</CWidgetSimple>
|
</CWidgetSimple>
|
||||||
</CCol>
|
</CCol>
|
||||||
</CRow>
|
</CRow>
|
||||||
@@ -337,10 +325,13 @@
|
|||||||
<script>
|
<script>
|
||||||
import WidgetsSocial from './WidgetsSocial'
|
import WidgetsSocial from './WidgetsSocial'
|
||||||
import WidgetsDropdown from './WidgetsDropdown'
|
import WidgetsDropdown from './WidgetsDropdown'
|
||||||
|
import { CChartLineSimple, CChartBarSimple } from '../charts/index.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Widgets',
|
name: 'Widgets',
|
||||||
components: {
|
components: {
|
||||||
|
CChartLineSimple,
|
||||||
|
CChartBarSimple,
|
||||||
WidgetsSocial,
|
WidgetsSocial,
|
||||||
WidgetsDropdown
|
WidgetsDropdown
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,13 +15,14 @@
|
|||||||
<CDropdownItem disabled>Disabled action</CDropdownItem>
|
<CDropdownItem disabled>Disabled action</CDropdownItem>
|
||||||
</CDropdown>
|
</CDropdown>
|
||||||
</template>
|
</template>
|
||||||
<CSimplePointedChart
|
<CChartLineSimple
|
||||||
|
pointed
|
||||||
class="px-3"
|
class="px-3"
|
||||||
:data="[65, 59, 84, 84, 51, 55, 40]"
|
|
||||||
:labels="months"
|
|
||||||
style="height:70px"
|
style="height:70px"
|
||||||
|
:dataPoints="[65, 59, 84, 84, 51, 55, 40]"
|
||||||
|
backgroundColor="primary"
|
||||||
label="Members"
|
label="Members"
|
||||||
pointHoverColor="primary"
|
labels="months"
|
||||||
/>
|
/>
|
||||||
</CWidgetDropdown>
|
</CWidgetDropdown>
|
||||||
</CCol>
|
</CCol>
|
||||||
@@ -41,14 +42,15 @@
|
|||||||
<CDropdownItem disabled>Disabled action</CDropdownItem>
|
<CDropdownItem disabled>Disabled action</CDropdownItem>
|
||||||
</CDropdown>
|
</CDropdown>
|
||||||
</template>
|
</template>
|
||||||
<CSimplePointedChart
|
<CChartLineSimple
|
||||||
|
pointed
|
||||||
class="px-3"
|
class="px-3"
|
||||||
:data="[1, 18, 9, 17, 34, 22, 11]"
|
|
||||||
:labels="months"
|
|
||||||
style="height:70px"
|
style="height:70px"
|
||||||
label="Members"
|
:dataPoints="[1, 18, 9, 17, 34, 22, 11]"
|
||||||
|
backgroundColor="info"
|
||||||
:options="{ elements: { line: { tension: 0.00001 }}}"
|
:options="{ elements: { line: { tension: 0.00001 }}}"
|
||||||
pointHoverColor="info"
|
label="Members"
|
||||||
|
labels="months"
|
||||||
/>
|
/>
|
||||||
</CWidgetDropdown>
|
</CWidgetDropdown>
|
||||||
</CCol>
|
</CCol>
|
||||||
@@ -72,17 +74,15 @@
|
|||||||
<CDropdownItem disabled>Disabled action</CDropdownItem>
|
<CDropdownItem disabled>Disabled action</CDropdownItem>
|
||||||
</CDropdown>
|
</CDropdown>
|
||||||
</template>
|
</template>
|
||||||
|
<CChartLineSimple
|
||||||
<CSimpleLineChart
|
style="height:70px"
|
||||||
chartId="CWidgetDropdown_3"
|
backgroundColor="rgba(255,255,255,.2)"
|
||||||
:data="[78, 81, 80, 45, 34, 12, 40]"
|
:dataPoints="[78, 81, 80, 45, 34, 12, 40]"
|
||||||
:labels="months"
|
:options="{ elements: { line: { borderWidth: 2.5 }}}"
|
||||||
style="height:70px"
|
pointHoverBackgroundColor="warning"
|
||||||
color="rgba(255,255,255,.2)"
|
label="Members"
|
||||||
label="Members"
|
labels="months"
|
||||||
:options="{elements: {line: {borderWidth: 2.5}}}"
|
/>
|
||||||
pointHoverColor="warning"
|
|
||||||
/>
|
|
||||||
</CWidgetDropdown>
|
</CWidgetDropdown>
|
||||||
</CCol>
|
</CCol>
|
||||||
<CCol sm="6" lg="3">
|
<CCol sm="6" lg="3">
|
||||||
@@ -105,13 +105,11 @@
|
|||||||
<CDropdownItem disabled>Disabled action</CDropdownItem>
|
<CDropdownItem disabled>Disabled action</CDropdownItem>
|
||||||
</CDropdown>
|
</CDropdown>
|
||||||
</template>
|
</template>
|
||||||
|
<CChartBarSimple
|
||||||
<CSimpleBarChart
|
|
||||||
chartId="CWidgetDropdown_4"
|
|
||||||
:data="[10, 22, 34, 46, 58, 70, 46, 23, 45, 78, 34, 12]"
|
|
||||||
label="Members"
|
|
||||||
color="rgb(250, 152, 152)"
|
|
||||||
style="height:70px"
|
style="height:70px"
|
||||||
|
backgroundColor="rgb(250, 152, 152)"
|
||||||
|
label="Members"
|
||||||
|
labels="months"
|
||||||
/>
|
/>
|
||||||
</CWidgetDropdown>
|
</CWidgetDropdown>
|
||||||
</CCol>
|
</CCol>
|
||||||
@@ -119,12 +117,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { CChartLineSimple, CChartBarSimple } from '../charts/index.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'WidgetsDropdown',
|
name: 'WidgetsDropdown',
|
||||||
data () {
|
// data () {
|
||||||
return {
|
// return {
|
||||||
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July']
|
// months: ['January', 'February', 'March', 'April', 'May', 'June', 'July']
|
||||||
}
|
// }
|
||||||
}
|
// },
|
||||||
|
components: { CChartLineSimple, CChartBarSimple }
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template functional>
|
<template>
|
||||||
<CRow>
|
<CRow>
|
||||||
<template v-if="!props.noCharts">
|
<template v-if="!noCharts">
|
||||||
<CCol md="3" sm="6">
|
<CCol md="3" sm="6">
|
||||||
<CWidgetSocial
|
<CWidgetSocial
|
||||||
variant="facebook"
|
variant="facebook"
|
||||||
@@ -9,13 +9,12 @@
|
|||||||
leftHeader="459"
|
leftHeader="459"
|
||||||
leftFooter="feeds"
|
leftFooter="feeds"
|
||||||
>
|
>
|
||||||
<CSimpleLineChart
|
<CChartLineSimple
|
||||||
chartId="facebook"
|
|
||||||
:data="[65, 59, 84, 84, 51, 55, 40]"
|
|
||||||
label="Friends"
|
|
||||||
:labels="['January', 'February', 'March', 'April', 'May', 'June', 'July']"
|
|
||||||
style="height:100px"
|
style="height:100px"
|
||||||
color="rgba(255,255,255,.1)"
|
backgroundColor="rgba(255,255,255,.1)"
|
||||||
|
:dataPoints="[65, 59, 84, 84, 51, 55, 40]"
|
||||||
|
label="Friends"
|
||||||
|
labels="months"
|
||||||
/>
|
/>
|
||||||
</CWidgetSocial>
|
</CWidgetSocial>
|
||||||
</CCol>
|
</CCol>
|
||||||
@@ -27,13 +26,12 @@
|
|||||||
leftHeader="1.792"
|
leftHeader="1.792"
|
||||||
leftFooter="tweets"
|
leftFooter="tweets"
|
||||||
>
|
>
|
||||||
<CSimpleLineChart
|
<CChartLineSimple
|
||||||
chartId="twitter"
|
|
||||||
:data="[1, 13, 9, 17, 34, 41, 38]"
|
|
||||||
label="Followers"
|
|
||||||
:labels="['January', 'February', 'March', 'April', 'May', 'June', 'July']"
|
|
||||||
style="height:100px"
|
style="height:100px"
|
||||||
color="rgba(255,255,255,.1)"
|
backgroundColor="rgba(255,255,255,.1)"
|
||||||
|
:dataPoints="[1, 13, 9, 17, 34, 41, 38]"
|
||||||
|
label="Followers"
|
||||||
|
labels="months"
|
||||||
/>
|
/>
|
||||||
</CWidgetSocial>
|
</CWidgetSocial>
|
||||||
</CCol>
|
</CCol>
|
||||||
@@ -45,13 +43,12 @@
|
|||||||
leftHeader="292"
|
leftHeader="292"
|
||||||
leftFooter="feeds"
|
leftFooter="feeds"
|
||||||
>
|
>
|
||||||
<CSimpleLineChart
|
<CChartLineSimple
|
||||||
chartId="linkedIn"
|
|
||||||
:data="[78, 81, 80, 45, 34, 12, 40]"
|
|
||||||
label="Contracts"
|
|
||||||
:labels="['January', 'February', 'March', 'April', 'May', 'June', 'July']"
|
|
||||||
style="height:100px"
|
style="height:100px"
|
||||||
color="rgba(255,255,255,.1)"
|
backgroundColor="rgba(255,255,255,.1)"
|
||||||
|
:dataPoints="[78, 81, 80, 45, 34, 12, 40]"
|
||||||
|
label="Contracts"
|
||||||
|
labels="months"
|
||||||
/>
|
/>
|
||||||
</CWidgetSocial>
|
</CWidgetSocial>
|
||||||
</CCol>
|
</CCol>
|
||||||
@@ -63,13 +60,12 @@
|
|||||||
leftHeader="92"
|
leftHeader="92"
|
||||||
leftFooter="circles"
|
leftFooter="circles"
|
||||||
>
|
>
|
||||||
<CSimpleLineChart
|
<CChartLineSimple
|
||||||
chartId="google-plus"
|
|
||||||
:data="[35, 23, 56, 22, 97, 23, 64]"
|
|
||||||
label="Followers"
|
|
||||||
:labels="['January', 'February', 'March', 'April', 'May', 'June', 'July']"
|
|
||||||
style="height:100px"
|
style="height:100px"
|
||||||
color="rgba(255,255,255,.1)"
|
backgroundColor="rgba(255,255,255,.1)"
|
||||||
|
:dataPoints="[35, 23, 56, 22, 97, 23, 64]"
|
||||||
|
label="Followers"
|
||||||
|
labels="months"
|
||||||
/>
|
/>
|
||||||
</CWidgetSocial>
|
</CWidgetSocial>
|
||||||
</CCol>
|
</CCol>
|
||||||
@@ -117,8 +113,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { CChartLineSimple } from '../charts/index.js'
|
||||||
export default {
|
export default {
|
||||||
name: 'WidgetsSocial',
|
name: 'WidgetsSocial',
|
||||||
|
components: {
|
||||||
|
CChartLineSimple
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
noCharts: Boolean
|
noCharts: Boolean
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user