κ°€μ΄λ“œ
에셋(Assets)

에셋(Assets)

μ‹œλ¦¬μ¦ˆλ‚˜ κ²Œμ΄μ§€ λ˜λŠ” μΆ• label 등을 효과적으둜 ν‘œμ‹œν•  λ•Œ μ°Έμ‘°ν•˜λŠ” 미리 μ •μ˜λœ μŠ€νƒ€μΌ μš”μ†Œλ“€μ΄λ‹€.

Color List

차트 μ„€μ •μ—μ„œ 에셋 type은 'colors'이닀.
μ‚¬μš©ν•  색상 λͺ©λ‘μ„ λ³΄κ΄€ν•˜κ³  μ‹€ν–‰ 쀑 series.pointColors λ“±μ—μ„œ μ‚¬μš©ν•  수 μžˆλ„λ‘ ν•œλ‹€.

μ΅œμƒμœ„ 'asset' ν•­λͺ©μ˜ μžμ‹ μ•„μ΄ν…œμœΌλ‘œ μ„€μ •ν•œλ‹€.

{
    assets: [{
        type: 'colors',
        id: 'color1',
        colors: ['#88f', '#aaf', '#bbf', '#ddf', '#eef'],
        mode: 'suffle'
    }],
    series: {
        pointsColors: 'color1',
    }
}

'type'이 μ§€μ •λ˜μ§€ μ•Šκ³ , 'colors' 배열이 μ‘΄μž¬ν•˜λ©΄ 'colors'둜 μƒμ„±λœλ‹€.

Image List

에셋 type은 'images'이닀.

Linear Gradient

에셋 type은 'lineargradient'이닀.
μ‹œμž‘μ κ³Ό 끝점 사이에 색상이 μ„œμ„œνžˆ λ³€κ²½λ˜λŠ” 효과λ₯Ό ν‘œμ‹œν•œλ‹€. μ±„μš°κΈ° μƒ‰μ΄λ‚˜ μ„  μƒ‰μœΌλ‘œ μ‚¬μš©λ  수 μžˆλ‹€.

{
    assets: [{
        type: 'lineargradient',
        id: 'gradient-1',
        color: '#0088ff',
        opacity: [1, 0]
    }],
    series: {
        style: {
            fill: 'url(#gradient-1)',
            fillOpacity: 1,
            strokeWidth: '2px'
        }
    }
}

Radial Gradient

에셋 type은 'radialgradient'이닀.
원 μ€‘μ‹¬μ—μ„œ λ°”κΉ₯으둜 생상이 λ³€ν•΄κ°€λŠ” 효과λ₯Ό ν‘œμ‹œν•œλ‹€. μ±„μš°κΈ° μƒ‰μ΄λ‚˜ μ„  μƒ‰μœΌλ‘œ μ‚¬μš©λ  수 μžˆλ‹€.

{
    assets: [{
        type: 'radialgradient',
        id: 'gradient-1',
        color: '#0088ff',
        cx: 0.3,
        cy: 0.3,
        rd: 0.4
    }],
    series: {
        type: 'bubble',
        style: {
            fill: 'url(#gradient-1)'
        }
    }
}

Pattern

에셋 type은 'pattern'이닀.
λ„ν˜• νŒ¨ν„΄μ„ μ§€μ •ν•΄μ„œ μ±„μš°κΈ°(fill) 색상 λŒ€μ‹  μ‚¬μš©ν•  수 μžˆλ‹€.

{
    assets: [{
        type: 'pattern',
        id: 'pattern-1',
        pattern: 0,
        style: {
            stroke: 'black',
        }
    }],
    series: {
        style: {
            fill: 'url(#pattern-1)'
        }
    }
}

See Also