Yes. It is possible with custom widgets. Take a look at Google charts. You may need to create a custom widget from this.
When I tried to write a service using google chart java script in thingworx service and when i execute it,it throws an error.
Please help me on How to resolve this?
You cannot directly call those services. You need to create a widget extension. It should be explained in Help. I would say you can check existing one from ThingworxStorage/extensions folder. When you create an extension you need to override specific services as well.
Once you have done successfully, it will show up in the Mashup builder like other widgets. At that point it is simple drag and drop and configuration. You can even search this forum for additional help.
I hope this helps.