Skip to content

Instantly share code, notes, and snippets.

View strugglebak's full-sized avatar
🎯
Focusing

Chang strugglebak

🎯
Focusing
View GitHub Profile
@strugglebak
strugglebak / connect.js
Created March 2, 2020 07:50 — forked from gaearon/connect.js
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@strugglebak
strugglebak / hc-column-demo2.js
Created May 9, 2019 08:18
hightchart js demo: hc-column-demo2
Highcharts.chart('container',{
chart: {
type: 'column'
},
title: {
text: ''
},
credits: {
enabled: false
},
@strugglebak
strugglebak / hc-column-demo1.js
Last active May 9, 2019 08:19
hightchart js demo: hc-column-demo1
Highcharts.chart('container', {
chart: {
type: 'column'
},
colors: ['#F2276F', '#25B9D0', '#FDA844', '#388CFF'],
title: {
text: ''
},
credits: {
enabled: false
@strugglebak
strugglebak / hc-pie-demo1.js
Created May 9, 2019 07:30
hightchart js demo: hc-pie-demo1
Highcharts.chart('container', {
chart: {
width: 80,
height: 80
},
title: {
floating:true,
text: '20',
},
credits: {
@strugglebak
strugglebak / hc-bar-chart-demo1.js
Created May 9, 2019 06:11
hightchart js demo: hc-bar-chart-demo1
Highcharts.chart('container', {
chart: {
type: 'bar'
},
title: {
text: ''
},
credits: {
@strugglebak
strugglebak / hc-line-chart-demo2.js
Last active May 9, 2019 07:39
hightchart js demo: hc-line-chart-demo2
var result = {
date: '高二19-20期末',
score: 75
};
Highcharts.chart('container', {
chart: {
zoomType: 'x',
},
@strugglebak
strugglebak / hc-line-chart-demo1.js
Created May 9, 2019 02:05
hightchart js demo2: hc-line-chart-demo1
Highcharts.chart('container', {
chart: {
zoomType: 'x'
},
title: {
text: ''
},
credits: {
enabled: false
@strugglebak
strugglebak / hc-radar-demo1.js
Last active May 9, 2019 08:41
hightchart js demo1: radar-demo1
Highcharts.chart('container', {
chart: {
polar: true,
// 控制图表尺寸
width: 200,
height: 160,
},
title: {
@strugglebak
strugglebak / ec-radar-demo1.js
Last active May 9, 2019 02:08
echarts js demo4: radar-demo1.js
options = {
legend: {
left: '40',
top: '145',
data: [
{
name: '个人',
icon: 'line',
textStyle: {
fontSize: 10,
@strugglebak
strugglebak / ec-histogram-demo1.js
Last active May 9, 2019 02:09
echarts js demo3: histogram-demo1
var option = {
color: '#8FBEFF',
dataset: {
source: [
['learningTime', 'task'],
[120, '习题'],
[30, '导学案'],
[20, '课件'],
[100, '微课'],
[300, '直播课程'],