Giter Club home page Giter Club logo

Comments (10)

dielduarte avatar dielduarte commented on August 28, 2024 6

hey @plouc, any news related to linear gradients in an area?

from nivo.

plouc avatar plouc commented on August 28, 2024 1

Started something for the gradient support => http://nivo.rocks/#/guides/gradients, but it's not available for line chart for now, just on Stream.

from nivo.

plouc avatar plouc commented on August 28, 2024 1

Area support has been added to line chart #82

from nivo.

plouc avatar plouc commented on August 28, 2024

For now it's not, charts use colors range for the sake of simple use.

from nivo.

Eric0201 avatar Eric0201 commented on August 28, 2024

with pie chart ? @plouc

from nivo.

pnikytynskyi avatar pnikytynskyi commented on August 28, 2024

up

from nivo.

arualana avatar arualana commented on August 28, 2024

Hi, the gradient on line chart area is not working

<Line
        data={data}
        width={700}
        height={310}            
        xScale={{ type: 'point' }}
        yScale={{ type: 'linear', stacked: false, min: 0, max: 400 }}
        curve="linear"
        axisTop={null}
        axisRight={null}
        axisBottom={null}
        axisLeft={null}
        enableGridX={false}
        enableGridY={false}
        colors={d => d.color}
        enablePoints={false}           
        enableSlices="x"            
        enableArea={true}
        areaBlendMode="screen"
        areaOpacity={0.16}
        keys={['react', 'vue', 'elm']}
        defs={[{
          id: 'gradientC',
          type: 'linearGradient',
          colors: [
            { offset: 0, color: '#fff' },
            { offset: 100, color: '#000' },
          ],
        },]}
        fill={[
          { match: '*', id: 'gradientC' },
        ]}
        useMesh={true}
/>

Above is my code, the gradient is not being rendered whatsoever.

I also tried the example in the docs, and still no gradient shows

<Line
        data={data}
        width={700}
        height={310}
        margin={{ top: 0, right: 0, bottom: 0, left: 0 }}
        xScale={{ type: 'point' }}
        yScale={{ type: 'linear', stacked: false, min: 0, max: 400 }}
        curve="linear"
        axisTop={null}
        axisRight={null}
        axisBottom={null}
        axisLeft={null}
        enableGridX={false}
        enableGridY={false}
        keys={['react', 'vue', 'elm']}
        // 1. defining gradients
        defs={[
          // using helpers
          // will inherit colors from current element
          linearGradientDef('gradientA', [
            { offset: 0, color: 'inherit' },
            { offset: 100, color: 'inherit', opacity: 0 },
          ]),
          linearGradientDef('gradientB', [
            { offset: 0, color: '#000' },
            { offset: 100, color: 'inherit' },
          ]),
          // using plain object
          {
            id: 'gradientC',
            type: 'linearGradient',
            colors: [
                { offset: 0, color: '#faf047' },
                { offset: 100, color: '#e4b400' },
            ]

        } ]}
        // 2. defining rules to apply those gradients
        fill={[
          // match using object query
          { match: { id: 'react' }, id: 'gradientA' },
          // match using function
          { match: d => d.id === 'vue', id: 'gradientB' },
          // match all, will only affect 'elm', because once a rule match,
          // others are skipped, so now it acts as a fallback
          { match: '*', id: 'gradientC' },
      ]}
/>

from nivo.

tomaswitek avatar tomaswitek commented on August 28, 2024

There is an opened PR which seems to solve this issue.

from nivo.

stale avatar stale commented on August 28, 2024

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

from nivo.

stale avatar stale commented on August 28, 2024

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

from nivo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.