quoslibero
Version:
FusionCharts JavaScript charting framework
1 lines • 1.31 kB
JavaScript
import ScrollBar from'../../../../fc-core/src/toolbox/tools/scrollbar';export default(a=>{let b,c=a.attachChild(ScrollBar,'scrollbar'),d=c.getFromEnv('dataSource'),e=c.getFromEnv('getStyleDef'),f=d.navigator&&d.navigator.scrollbar&&d.navigator.scrollbar.style||{};b={button:Object.assign({stroke:a.getScrollbarConfig('buttonStroke'),fill:a.getScrollbarConfig('buttonFill')},e(f.button)),arrow:Object.assign({fill:a.getScrollbarConfig('buttonPointerFill')},e(f.arrow)),scroller:Object.assign({stroke:a.getScrollbarConfig('anchorStroke'),fill:a.getScrollbarConfig('anchorFill')},e(f.scroller)),grip:Object.assign({stroke:a.getScrollbarConfig('stripesStroke')},e(f.grip)),track:Object.assign({stroke:a.getScrollbarConfig('trackStroke'),fill:a.getScrollbarConfig('trackFill')},e(f.track))},c.configure({isHorizontal:!0,displayFlat:!0,width:a.getScrollbarConfig('width'),height:a.getScrollbarConfig('height'),style:b,drawStripes:a.getScrollbarConfig('drawStripes'),restrictScrollAnchor:a.getScrollbarConfig('restrictScrollAnchor'),scrollRatio:a.getScrollbarConfig('scrollRatio')}),c.attachEventHandlers({scroll:function(b){let c=a.getChildren('scrollbar')[0].config,d=c.width,e=c.height,f=a.getScrollbarConfig('scrollRatio'),g=Math.min(e,.5*d),h=(d-2*g)*f-1,i=c.x+g+.5,j=i+(d-2*g-h)*b;a.validateDomain([j,j+h])}})});