create chart dynamically